From owner-svn-src-head@freebsd.org Sun Apr 14 00:06:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1C4915871E9; Sun, 14 Apr 2019 00:06:51 +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 282D471CDB; Sun, 14 Apr 2019 00:06:51 +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 F17151888B; Sun, 14 Apr 2019 00:06:50 +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 x3E06o0l056441; Sun, 14 Apr 2019 00:06:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3E06nxf056436; Sun, 14 Apr 2019 00:06:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904140006.x3E06nxf056436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sun, 14 Apr 2019 00:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346196 - in head/lib/libpmc: . pmu-events X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/lib/libpmc: . pmu-events X-SVN-Commit-Revision: 346196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 282D471CDB 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)[-1.000,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: Sun, 14 Apr 2019 00:06:51 -0000 Author: ngie Date: Sun Apr 14 00:06:49 2019 New Revision: 346196 URL: https://svnweb.freebsd.org/changeset/base/346196 Log: Fix warnings with lib/libpmc * Use `MIN` instead of similar hand rolled macro. * Sort headers. * Use `errno.h` instead of `sys/errno.h`. * Wrap the argument to sizeof in parentheses for clarity. * Remove `__BSD_VISIBLE` and `_XOPEN_SOURCE` #defines to mute warnings about incompatible snprintf definitions. This fixes a number of warnings I've been seeing lately in my builds. Sort makefile variables per style.Makefile(9) (`CFLAGS`/`CWARNFLAG.gcc`) and bump `WARNS` to 3. MFC after: 2 weeks Reviewed by: jtl Approved by: jtl (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19851 Added: head/lib/libpmc/Makefile.inc (contents, props changed) Modified: head/lib/libpmc/Makefile head/lib/libpmc/libpmc_json.cc head/lib/libpmc/pmu-events/jevents.c head/lib/libpmc/pmu-events/jevents.h Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Sat Apr 13 23:52:33 2019 (r346195) +++ head/lib/libpmc/Makefile Sun Apr 14 00:06:49 2019 (r346196) @@ -6,9 +6,6 @@ LIB= pmc SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc INCS= pmc.h pmclog.h pmcformat.h -CFLAGS+= -I${.CURDIR} -CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align - .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" .if ${MACHINE_ARCH} == "aarch64" @@ -30,6 +27,11 @@ libpmc_events.c: ${JEVENTS} ${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch libpmc_events.c SRCS+= libpmc_events.c .endif + +WARNS?= 3 + +CFLAGS+= -I${.CURDIR} +CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align MAN= pmc.3 MAN+= pmc_allocate.3 Added: head/lib/libpmc/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/Makefile.inc Sun Apr 14 00:06:49 2019 (r346196) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +WARNS?= 3 Modified: head/lib/libpmc/libpmc_json.cc ============================================================================== --- head/lib/libpmc/libpmc_json.cc Sat Apr 13 23:52:33 2019 (r346195) +++ head/lib/libpmc/libpmc_json.cc Sun Apr 14 00:06:49 2019 (r346196) @@ -29,19 +29,21 @@ */ #include -#include #include -#include -#include +#include #include +#include #include +#include +#include +#include #include -#include -#include -#include #include #include + +#include #include +#include using std::string; Modified: head/lib/libpmc/pmu-events/jevents.c ============================================================================== --- head/lib/libpmc/pmu-events/jevents.c Sat Apr 13 23:52:33 2019 (r346195) +++ head/lib/libpmc/pmu-events/jevents.c Sun Apr 14 00:06:49 2019 (r346196) @@ -1,5 +1,3 @@ -#define _XOPEN_SOURCE 500 /* needed for nftw() */ -#define __BSD_VISIBLE 1 /* needed for asprintf() */ /* Parse event JSON files */ /* @@ -33,22 +31,22 @@ * */ - +#include +#include /* getrlimit */ +#include +#include /* getrlimit */ +#include +#include +#include +#include +#include +#include #include #include #include -#include #include -#include #include -#include -#include -#include -#include -#include /* getrlimit */ -#include /* getrlimit */ #include -#include #include "list.h" #include "jsmn.h" #include "json.h" @@ -641,7 +639,7 @@ int json_events(const char *fn, addfield(map, &extra_desc, " ", "(Precise event)", NULL); } - snprintf(buf, sizeof buf, "event=%#llx", eventcode); + snprintf(buf, sizeof(buf), "event=%#llx", eventcode); addfield(map, &event, ",", buf, NULL); if (desc && extra_desc) addfield(map, &desc, " ", extra_desc, NULL); @@ -866,7 +864,7 @@ static int get_maxfds(void) if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) { if (rlim.rlim_max == RLIM_INFINITY) return 512; - return min((unsigned)rlim.rlim_max / 2, 512); + return MIN(rlim.rlim_max / 2, 512); } return 512; Modified: head/lib/libpmc/pmu-events/jevents.h ============================================================================== --- head/lib/libpmc/pmu-events/jevents.h Sat Apr 13 23:52:33 2019 (r346195) +++ head/lib/libpmc/pmu-events/jevents.h Sun Apr 14 00:06:49 2019 (r346196) @@ -11,12 +11,4 @@ int json_events(const char *fn, void *data); char *get_cpu_str(void); -#ifndef min -#define min(x, y) ({ \ - typeof(x) _min1 = (x); \ - typeof(y) _min2 = (y); \ - (void) (&_min1 == &_min2); \ - _min1 < _min2 ? _min1 : _min2; }) -#endif - #endif From owner-svn-src-head@freebsd.org Sun Apr 14 10:18:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 064CB156FE80; Sun, 14 Apr 2019 10:18:15 +0000 (UTC) (envelope-from tuexen@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 9B42F8A10B; Sun, 14 Apr 2019 10:18:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EFD61F090; Sun, 14 Apr 2019 10:18:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3EAIE8B078171; Sun, 14 Apr 2019 10:18:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3EAIETP078170; Sun, 14 Apr 2019 10:18:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201904141018.x3EAIETP078170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Apr 2019 10:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346197 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B42F8A10B 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)[-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: Sun, 14 Apr 2019 10:18:15 -0000 Author: tuexen Date: Sun Apr 14 10:18:14 2019 New Revision: 346197 URL: https://svnweb.freebsd.org/changeset/base/346197 Log: When sending a routing message, don't allow the user to set the RTF_RNH_LOCKED flag in rtm_flags, since this flag is used only internally. Reported by: syzbot+65c676f5248a13753ea0@syzkaller.appspotmail.com Reviewed by: ae@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19898 Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 14 00:06:49 2019 (r346196) +++ head/sys/net/rtsock.c Sun Apr 14 10:18:14 2019 (r346197) @@ -618,6 +618,8 @@ route_output(struct mbuf *m, struct socket *so, ...) if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) senderr(EINVAL); + if (rtm->rtm_flags & RTF_RNH_LOCKED) + senderr(EINVAL); info.rti_flags = rtm->rtm_flags; if (info.rti_info[RTAX_DST] == NULL || info.rti_info[RTAX_DST]->sa_family >= AF_MAX || From owner-svn-src-head@freebsd.org Sun Apr 14 13:37:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3DD815765B1; Sun, 14 Apr 2019 13:37:51 +0000 (UTC) (envelope-from bde@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 4369C6AFEB; Sun, 14 Apr 2019 13:37:51 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C342212B9; Sun, 14 Apr 2019 13:37:51 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3EDbokg084986; Sun, 14 Apr 2019 13:37:50 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3EDboMO084985; Sun, 14 Apr 2019 13:37:50 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904141337.x3EDboMO084985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Apr 2019 13:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346215 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4369C6AFEB 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.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 14 Apr 2019 13:37:51 -0000 Author: bde Date: Sun Apr 14 13:37:50 2019 New Revision: 346215 URL: https://svnweb.freebsd.org/changeset/base/346215 Log: For writing and reading single pixels, avoid some pessimizations for depths > 8. Add some smaller optimizations for these depths. Use a more generic method for all depths >= 8, although this gives tiny pessimizations for these depths. For clearing the whole frame buffer, avoid the same pessimizations for depths > 8. Add some larger optimizations for these depths. Use an even more generic method for all depths >= 8 to give the optimizations for depths > 8 and a tiny pessimization for depth 8. The main pessimization was that old versions of bcopy() copy 1 byte at a time for all trailing bytes. (i386 still does this. amd64 now pessimizzes large sizes instead of small ones if the CPU supports ERMS. dev/fb gets this wrong by mostly not using the bcopy() family or the technically correct bus space functions but by mostly copying 2 bytes at a time using an unoptimized loop without even volatile declarations to prevent the compiler rewriting it.) The sizes here are 1, 2, 3 or 4 bytes, so depths 9-16 were up to twice as slow as necessary and depths 17-24 were up to 3 times slower than necessary. Fix this (except depths 17-24 are still up to 2 times slower than necessary) by using (builtin) memcpy() instead of bcopy() and reorganizing so that the complier can see the small constant sizes. Reduce special cases while reorganizing although this is slightly slower than adding special cases. The compiler inlining (and even -O2 vs -O0) makes little difference compared with reducing the number of accesses except on modern hardware it gives a small improvement. Clearing was also pessimized mainly by the extra accesses. Fix it quite differently by creating a MEMBUF containing 1 line (in fast memory using a slow method) and copying this. This is only slightly slower than reducing everything to efficient memset()s and bcopy()s, but simpler, especially for the segmented case. This works for planar modes too, but don't use it then since the old method was actually optimal for planar modes (it works by moving the slow i/o instructions out of inner loops), while for direct modes the slow instructions were all in the invisible inner loop in bcopy(). Use htole32() and le32toh() and some type puns instead of unoptimized functions for converting colors. This optimization is mostly in the noise. libvgl is only supported on x86, so it could hard-code the assumption that the byte order is le32, but the old conversion functions didn't hard-code this. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Sun Apr 14 13:17:40 2019 (r346214) +++ head/lib/libvgl/simple.c Sun Apr 14 13:37:50 2019 (r346215) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "vgl.h" static byte VGLSavePaletteRed[256]; @@ -44,96 +45,44 @@ static byte VGLSavePaletteBlue[256]; #define min(x, y) (((x) < (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y)) -static void -color2mem(u_long color, byte *b, int len) -{ - switch (len) { - case 4: - b[3] = (color >> 24) & 0xff; - /* fallthrough */ - case 3: - b[2] = (color >> 16) & 0xff; - /* fallthrough */ - case 2: - b[1] = (color >> 8) & 0xff; - /* fallthrough */ - case 1: - default: - b[0] = color & 0xff; - break; - } - - return; -} - -static u_long -mem2color(byte *b, int len) -{ - u_long color = 0; - - switch (len) { - case 4: - color |= (b[3] & 0xff) << 24; - /* fallthrough */ - case 3: - color |= (b[2] & 0xff) << 16; - /* fallthrough */ - case 2: - color |= (b[1] & 0xff) << 8; - /* fallthrough */ - case 1: - default: - color |= (b[0] & 0xff); - break; - } - - return color; -} - void VGLSetXY(VGLBitmap *object, int x, int y, u_long color) { int offset; - byte b[4]; VGLCheckSwitch(); if (x>=0 && xVXsize && y>=0 && yVYsize) { if (object->Type == MEMBUF || !VGLMouseFreeze(x, y, 1, 1, 0x80000000 | color)) { + offset = (y * object->VXsize + x) * object->PixelBytes; switch (object->Type) { + case VIDBUF8S: + case VIDBUF16S: + case VIDBUF24S: + case VIDBUF32S: + offset = VGLSetSegment(offset); + /* FALLTHROUGH */ case MEMBUF: - switch (object->PixelBytes) { - case 2: - goto vidbuf16; - case 3: - goto vidbuf24; - case 4: - goto vidbuf32; - } - /* fallthrough */ case VIDBUF8: - object->Bitmap[y*object->VXsize+x]=((byte)color); - break; - case VIDBUF8S: - object->Bitmap[VGLSetSegment(y*object->VXsize+x)]=((byte)color); - break; case VIDBUF16: -vidbuf16: case VIDBUF24: -vidbuf24: case VIDBUF32: -vidbuf32: - color2mem(color, b, object->PixelBytes); - bcopy(b, &object->Bitmap[(y*object->VXsize+x) * object->PixelBytes], - object->PixelBytes); + color = htole32(color); + switch (object->PixelBytes) { + case 1: + memcpy(&object->Bitmap[offset], &color, 1); + break; + case 2: + memcpy(&object->Bitmap[offset], &color, 2); + break; + case 3: + memcpy(&object->Bitmap[offset], &color, 3); + break; + case 4: + memcpy(&object->Bitmap[offset], &color, 4); + break; + } break; - case VIDBUF16S: - case VIDBUF24S: - case VIDBUF32S: - color2mem(color, b, object->PixelBytes); - offset = VGLSetSegment((y*object->VXsize+x) * object->PixelBytes); - bcopy(b, &object->Bitmap[offset], object->PixelBytes); - break; case VIDBUF8X: outb(0x3c4, 0x02); outb(0x3c5, 0x01 << (x&0x3)); @@ -161,42 +110,38 @@ static u_long __VGLGetXY(VGLBitmap *object, int x, int y) { int offset; - byte b[4]; int i; u_long color; byte mask; + offset = (y * object->VXsize + x) * object->PixelBytes; switch (object->Type) { + case VIDBUF8S: + case VIDBUF16S: + case VIDBUF24S: + case VIDBUF32S: + offset = VGLSetSegment(offset); + /* FALLTHROUGH */ case MEMBUF: - switch (object->PixelBytes) { - case 2: - goto vidbuf16; - case 3: - goto vidbuf24; - case 4: - goto vidbuf32; - } - /* fallthrough */ case VIDBUF8: - return object->Bitmap[((y*object->VXsize)+x)]; - case VIDBUF8S: - return object->Bitmap[VGLSetSegment(y*object->VXsize+x)]; case VIDBUF16: -vidbuf16: case VIDBUF24: -vidbuf24: case VIDBUF32: -vidbuf32: - bcopy(&object->Bitmap[(y*object->VXsize+x) * object->PixelBytes], - b, object->PixelBytes); - return (mem2color(b, object->PixelBytes)); - case VIDBUF16S: - case VIDBUF24S: - case VIDBUF32S: - offset = VGLSetSegment((y*object->VXsize+x) * object->PixelBytes); - bcopy(&object->Bitmap[offset], b, object->PixelBytes); - - return (mem2color(b, object->PixelBytes)); + switch (object->PixelBytes) { + case 1: + memcpy(&color, &object->Bitmap[offset], 1); + return le32toh(color) & 0xff; + case 2: + memcpy(&color, &object->Bitmap[offset], 2); + return le32toh(color) & 0xffff; + case 3: + memcpy(&color, &object->Bitmap[offset], 3); + return le32toh(color) & 0xffffff; + case 4: + memcpy(&color, &object->Bitmap[offset], 4); + return le32toh(color); + } + break; case VIDBUF8X: outb(0x3ce, 0x04); outb(0x3cf, x & 0x3); return object->Bitmap[(unsigned)(VGLAdpInfo.va_line_width*y)+(x/4)]; @@ -539,63 +484,38 @@ VGLFilledEllipse(VGLBitmap *object, int xc, int yc, in void VGLClear(VGLBitmap *object, u_long color) { + VGLBitmap src; int offset; int len; - int i, total = 0; - byte b[4]; + int i; VGLCheckSwitch(); if (object->Type != MEMBUF) VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color); switch (object->Type) { case MEMBUF: - switch (object->PixelBytes) { - case 2: - goto vidbuf16; - case 3: - goto vidbuf24; - case 4: - goto vidbuf32; - } - /* fallthrough */ case VIDBUF8: - memset(object->Bitmap, (byte)color, object->VXsize*object->VYsize); - break; - case VIDBUF8S: - for (offset = 0; offset < object->VXsize*object->VYsize; ) { - VGLSetSegment(offset); - len = min(object->VXsize*object->VYsize - offset, - VGLAdpInfo.va_window_size); - memset(object->Bitmap, (byte)color, len); - offset += len; - } - break; case VIDBUF16: -vidbuf16: - case VIDBUF24: -vidbuf24: - case VIDBUF32: -vidbuf32: - color2mem(color, b, object->PixelBytes); - total = object->VXsize*object->VYsize*object->PixelBytes; - for (i = 0; i < total; i += object->PixelBytes) - bcopy(b, object->Bitmap + i, object->PixelBytes); - break; - case VIDBUF16S: + case VIDBUF24: case VIDBUF24S: + case VIDBUF32: case VIDBUF32S: - color2mem(color, b, object->PixelBytes); - total = object->VXsize*object->VYsize*object->PixelBytes; - for (offset = 0; offset < total; ) { - VGLSetSegment(offset); - len = min(total - offset, VGLAdpInfo.va_window_size); - for (i = 0; i < len; i += object->PixelBytes) - bcopy(b, object->Bitmap + (offset + i) % VGLAdpInfo.va_window_size, - object->PixelBytes); - offset += len; - } + src.Type = MEMBUF; + src.Xsize = object->Xsize; + src.VXsize = object->VXsize; + src.Ysize = 1; + src.VYsize = 1; + src.Xorigin = 0; + src.Yorigin = 0; + src.Bitmap = alloca(object->VXsize * object->PixelBytes); + src.PixelBytes = object->PixelBytes; + color = htole32(color); + for (i = 0; i < object->VXsize; i++) + bcopy(&color, src.Bitmap + i * object->PixelBytes, object->PixelBytes); + for (i = 0; i < object->VYsize; i++) + __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VYsize, 1); break; case VIDBUF8X: From owner-svn-src-head@freebsd.org Sun Apr 14 15:19:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A228157857C; Sun, 14 Apr 2019 15:19:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03EEC6DDF8; Sun, 14 Apr 2019 15:19:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm1-x331.google.com with SMTP id z24so17043469wmi.5; Sun, 14 Apr 2019 08:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wIAcKt77BrlhQeePUMwhnHR7UZrckdVrnOdVhiE+e8Y=; b=ejxeVdj0TFOOinK6twoT3j5lNQVitHFsP3EOQpLTa8FkW+Nh/O+D3CouXT3DwZrHGk K+RcIbUByiSKh9VIsRnAETCeGQE/RKcsBUfNSkmsjftDWqjTMaoR0daNU/VWRZSPCcqn pEMAAEdNO03CMW47K7fCQbdL5IeMINFh00ZnF2ZyuYw9b2J02BzOdXDnMjVplv5cyJVz QESDP7R4/CumhKZ7r317vUDmaACg3zuEjUOogm9axZ/R1SETtKs0gAyQnvMlb+uVEeJj FJ1wwdShPPzQisopnbJ1wEF012ksQfh7wl/RtZavXh7K/zih90Y1lQ3kVuOHnpG2wQUl d+ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wIAcKt77BrlhQeePUMwhnHR7UZrckdVrnOdVhiE+e8Y=; b=mQbKTcqyfsVY8O6lSNyCwmQYanSZ1bPYQCPzQem+AGc96BEg2Hygx1u5/OMBMiDVSV TU0KTzRAZRwj5yUh64EcTRPmr4Da1oBqQPaY67VEAEnRTgTSPx+exPDZ/Dc9gO2xBSeA Ar12w0Jj5fdoTpm8biDA0PxFa3XBT8Ibfdwwp/5oHhcBm7vnrWO1W6KxEkpkx1ipDg2U c8BylCtqO8b33zxOVflHBr/H/nxIPz3FrEe6ojGgUgPpIUw+16RuLghAVFCWGD3pVKbY DDD04EeaauVU6392GkLU5eNniRoOOe5aLMuQKoZBSSwE3J7kWaGzcEf7Ygyc7IBCGNxK JyTw== X-Gm-Message-State: APjAAAUE5LICVVubYJu7ca6kDcV7UEsHB4asth8vdufksnnp+lyJZpsJ ERRNnsTd1nKyOJA9oL6T2Wuq61cyu2oXbndUzcpZKA== X-Google-Smtp-Source: APXvYqy5Sset3BB2gJ2DJd6mCD1PRRc3CkGtoG/CAtT1RmbUEaWkU764VKjBoxtZy0Y0G/057JDtISms0sW9rBWvL+o= X-Received: by 2002:a1c:6309:: with SMTP id x9mr18538818wmb.101.1555255174900; Sun, 14 Apr 2019 08:19:34 -0700 (PDT) MIME-Version: 1.0 References: <201904041632.x34GWR4Z006164@repo.freebsd.org> In-Reply-To: <201904041632.x34GWR4Z006164@repo.freebsd.org> From: Adrian Chadd Date: Sun, 14 Apr 2019 08:19:22 -0700 Message-ID: Subject: Re: svn commit: r345875 - in head: contrib/elftoolchain/strings usr.bin/strings To: Mariusz Zaborski Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 03EEC6DDF8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ejxeVdj0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2a00:1450:4864:20::331 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-6.69 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[1.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; IP_SCORE(-2.79)[ip: (-9.32), ipnet: 2a00:1450::/32(-2.39), asn: 15169(-2.19), country: US(-0.06)]; NEURAL_HAM_SHORT(-0.89)[-0.890,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sun, 14 Apr 2019 15:19:38 -0000 This exposed a fun bug - gcc mips 6.4.0 complains about an unused arg (fa) in fileargs_fopen() in the strings change when you compile without casper support. I do that on mips. I have a local change that converts the #define to an inline function so the unused arg can be (void)'ed away. Mind if I commit it? -adrian On Thu, 4 Apr 2019 at 09:32, Mariusz Zaborski wrote: > Author: oshogbo > Date: Thu Apr 4 16:32:27 2019 > New Revision: 345875 > URL: https://svnweb.freebsd.org/changeset/base/345875 > > Log: > strings: capsicumize it > > Reviewed by: cem > Discussed with: emaste > Differential Revision: https://reviews.freebsd.org/D18038 > > Modified: > head/contrib/elftoolchain/strings/strings.c > head/usr.bin/strings/Makefile > > Modified: head/contrib/elftoolchain/strings/strings.c > > ============================================================================== > --- head/contrib/elftoolchain/strings/strings.c Thu Apr 4 12:02:48 2019 > (r345874) > +++ head/contrib/elftoolchain/strings/strings.c Thu Apr 4 16:32:27 2019 > (r345875) > @@ -25,8 +25,10 @@ > */ > > #include > +#include > #include > > +#include > #include > #include > #include > @@ -44,6 +46,9 @@ > #include > #include > > +#include > +#include > + > #include "_elftc.h" > > ELFTC_VCSID("$Id: strings.c 3648 2018-11-22 23:26:43Z emaste $"); > @@ -85,7 +90,7 @@ static struct option strings_longopts[] = { > }; > > int getcharacter(FILE *, long *); > -int handle_file(const char *); > +int handle_file(fileargs_t *fa, const char *); > int handle_elf(const char *, FILE *); > int handle_binary(const char *, FILE *, size_t); > int find_strings(const char *, FILE *, off_t, off_t); > @@ -99,6 +104,8 @@ void usage(void); > int > main(int argc, char **argv) > { > + fileargs_t *fa; > + cap_rights_t rights; > int ch, rc; > > rc = 0; > @@ -187,27 +194,41 @@ main(int argc, char **argv) > argc -= optind; > argv += optind; > > + cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL); > + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights); > + if (fa == NULL) > + err(1, "Unable to initialize casper fileargs"); > + > + caph_cache_catpages(); > + if (caph_limit_stdio() < 0 && caph_enter_casper() < 0) { > + fileargs_free(fa); > + err(1, "Unable to enter capability mode"); > + } > + > if (min_len == 0) > min_len = 4; > if (*argv == NULL) > rc = find_strings("{standard input}", stdin, 0, 0); > else while (*argv != NULL) { > - if (handle_file(*argv) != 0) > + if (handle_file(fa, *argv) != 0) > rc = 1; > argv++; > } > + > + fileargs_free(fa); > + > return (rc); > } > > int > -handle_file(const char *name) > +handle_file(fileargs_t *fa, const char *name) > { > FILE *pfile; > int rt; > > if (name == NULL) > return (1); > - pfile = fopen(name, "rb"); > + pfile = fileargs_fopen(fa, name, "rb"); > if (pfile == NULL) { > warnx("'%s': %s", name, strerror(errno)); > return (1); > > Modified: head/usr.bin/strings/Makefile > > ============================================================================== > --- head/usr.bin/strings/Makefile Thu Apr 4 12:02:48 2019 > (r345874) > +++ head/usr.bin/strings/Makefile Thu Apr 4 16:32:27 2019 > (r345875) > @@ -10,6 +10,12 @@ PROG= strings > > LIBADD= elftc elf > > +.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING) > +LIBADD+= casper > +LIBADD+= cap_fileargs > +CFLAGS+= -DWITH_CASPER > +.endif > + > CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common > > .include > > From owner-svn-src-head@freebsd.org Sun Apr 14 18:04:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A0F157CD07; Sun, 14 Apr 2019 18:04:54 +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 DA15774899; Sun, 14 Apr 2019 18:04:53 +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 B2B2024189; Sun, 14 Apr 2019 18:04:53 +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 x3EI4rhi029800; Sun, 14 Apr 2019 18:04:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3EI4rex029798; Sun, 14 Apr 2019 18:04:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904141804.x3EI4rex029798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Apr 2019 18:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346216 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 346216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA15774899 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.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Sun, 14 Apr 2019 18:04:54 -0000 Author: kib Date: Sun Apr 14 18:04:53 2019 New Revision: 346216 URL: https://svnweb.freebsd.org/changeset/base/346216 Log: ld-elf.so: make LD_DEBUG always functional. This causes some increase of the dynamic linker size, but benefits of avoiding compiling private copy or the linker when debugging is required. definitely worth it. The dbg() calls can be compiled out by defining LD_NO_DEBUG symbol. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/debug.h Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sun Apr 14 13:37:50 2019 (r346215) +++ head/libexec/rtld-elf/Makefile Sun Apr 14 18:04:53 2019 (r346216) @@ -2,7 +2,7 @@ # Use the following command to build local debug version of dynamic # linker: -# make DEBUG_FLAGS=-g DEBUG=-DDEBUG WITHOUT_TESTS=yes all +# make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all .include PACKAGE= clibs Modified: head/libexec/rtld-elf/debug.h ============================================================================== --- head/libexec/rtld-elf/debug.h Sun Apr 14 13:37:50 2019 (r346215) +++ head/libexec/rtld-elf/debug.h Sun Apr 14 18:04:53 2019 (r346216) @@ -39,10 +39,10 @@ #include #include -extern void debug_printf(const char *, ...) __printflike(1, 2); +void debug_printf(const char *, ...) __printflike(1, 2); extern int debug; -#ifdef DEBUG +#ifndef NO_LD_DEBUG #define dbg(...) debug_printf(__VA_ARGS__) #else #define dbg(...) ((void) 0) From owner-svn-src-head@freebsd.org Mon Apr 15 01:27:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A57441585E18; Mon, 15 Apr 2019 01:27:17 +0000 (UTC) (envelope-from rmacklem@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 47CFA8A3FD; Mon, 15 Apr 2019 01:27:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36647D0E; Mon, 15 Apr 2019 01:27:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3F1RHWi062977; Mon, 15 Apr 2019 01:27:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3F1RG7X062973; Mon, 15 Apr 2019 01:27:16 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904150127.x3F1RG7X062973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 15 Apr 2019 01:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346217 - in head/sys: fs/nfs fs/nfsclient kern sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: fs/nfs fs/nfsclient kern sys X-SVN-Commit-Revision: 346217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47CFA8A3FD 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]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 15 Apr 2019 01:27:17 -0000 Author: rmacklem Date: Mon Apr 15 01:27:15 2019 New Revision: 346217 URL: https://svnweb.freebsd.org/changeset/base/346217 Log: Fix the NFSv4 client to safely find processes. r340744 broke the NFSv4 client, because it replaced pfind_locked() with a call to pfind(), since pfind() acquires the sx lock for the pid hash and the NFSv4 already holds a mutex when it does the call. The patch fixes the problem by recreating a pfind_any_locked() and adding the functions pidhash_slockall() and pidhash_sunlockall to acquire/release all of the pid hash locks. These functions are then used by the NFSv4 client instead of acquiring the allproc_lock and calling pfind(). Reviewed by: kib, mjg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19887 Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Sun Apr 14 18:04:53 2019 (r346216) +++ head/sys/fs/nfs/nfsport.h Mon Apr 15 01:27:15 2019 (r346217) @@ -692,8 +692,6 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx)) #define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx)) #define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx)) -#define NFSPROCLISTLOCK() sx_slock(&allproc_lock) -#define NFSPROCLISTUNLOCK() sx_sunlock(&allproc_lock) #define NFSLOCKSOCKREQ(r) mtx_lock(&((r)->nr_mtx)) #define NFSUNLOCKSOCKREQ(r) mtx_unlock(&((r)->nr_mtx)) #define NFSLOCKDS(d) mtx_lock(&((d)->nfsclds_mtx)) Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Apr 14 18:04:53 2019 (r346216) +++ head/sys/fs/nfsclient/nfs_clport.c Mon Apr 15 01:27:15 2019 (r346217) @@ -1156,7 +1156,7 @@ nfscl_procdoesntexist(u_int8_t *own) tl.cval[2] = *own++; tl.cval[3] = *own++; pid = tl.lval; - p = pfind(pid); + p = pfind_any_locked(pid); if (p == NULL) return (1); if (p->p_stats == NULL) { Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sun Apr 14 18:04:53 2019 (r346216) +++ head/sys/fs/nfsclient/nfs_clstate.c Mon Apr 15 01:27:15 2019 (r346217) @@ -1789,7 +1789,13 @@ nfscl_cleanupkext(struct nfsclclient *clp, struct nfsc struct nfscllockowner *lp, *nlp; struct nfscldeleg *dp; - NFSPROCLISTLOCK(); + /* + * All the pidhash locks must be acquired, since they are sx locks + * and must be acquired before the mutexes. The pid(s) that will + * be used aren't known yet, so all the locks need to be acquired. + * Fortunately, this function is only performed once/sec. + */ + pidhash_slockall(); NFSLOCKCLSTATE(); LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { @@ -1816,7 +1822,7 @@ nfscl_cleanupkext(struct nfsclclient *clp, struct nfsc } } NFSUNLOCKCLSTATE(); - NFSPROCLISTUNLOCK(); + pidhash_sunlockall(); } /* Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Apr 14 18:04:53 2019 (r346216) +++ head/sys/kern/kern_proc.c Mon Apr 15 01:27:15 2019 (r346217) @@ -193,7 +193,7 @@ procinit(void) pidhashtbl_lock = malloc(sizeof(*pidhashtbl_lock) * (pidhashlock + 1), M_PROC, M_WAITOK | M_ZERO); for (i = 0; i < pidhashlock + 1; i++) - sx_init(&pidhashtbl_lock[i], "pidhash"); + sx_init_flags(&pidhashtbl_lock[i], "pidhash", SX_DUPOK); pgrphashtbl = hashinit(maxproc / 4, M_PROC, &pgrphash); proc_zone = uma_zcreate("PROC", sched_sizeof_proc(), proc_ctor, proc_dtor, proc_init, proc_fini, @@ -365,6 +365,52 @@ inferior(struct proc *p) return (0); } return (1); +} + +/* + * Shared lock all the pid hash lists. + */ +void +pidhash_slockall(void) +{ + u_long i; + + for (i = 0; i < pidhashlock + 1; i++) + sx_slock(&pidhashtbl_lock[i]); +} + +/* + * Shared unlock all the pid hash lists. + */ +void +pidhash_sunlockall(void) +{ + u_long i; + + for (i = 0; i < pidhashlock + 1; i++) + sx_sunlock(&pidhashtbl_lock[i]); +} + +/* + * Similar to pfind_any(), this function finds zombies. + */ +struct proc * +pfind_any_locked(pid_t pid) +{ + struct proc *p; + + sx_assert(PIDHASHLOCK(pid), SX_LOCKED); + LIST_FOREACH(p, PIDHASH(pid), p_hash) { + if (p->p_pid == pid) { + PROC_LOCK(p); + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); + p = NULL; + } + break; + } + } + return (p); } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Apr 14 18:04:53 2019 (r346216) +++ head/sys/sys/proc.h Mon Apr 15 01:27:15 2019 (r346217) @@ -989,8 +989,11 @@ extern struct uma_zone *proc_zone; struct proc *pfind(pid_t); /* Find process by id. */ struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */ +struct proc *pfind_any_locked(pid_t pid); /* Find process by id, locked. */ struct pgrp *pgfind(pid_t); /* Find process group by id. */ struct proc *zpfind(pid_t); /* Find zombie process by id. */ +void pidhash_slockall(void); /* Shared lock all pid hash lists. */ +void pidhash_sunlockall(void); /* Shared unlock all pid hash lists. */ struct fork_req { int fr_flags; From owner-svn-src-head@freebsd.org Mon Apr 15 02:42:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76D931587102; Mon, 15 Apr 2019 02:42:46 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B93098BEAC; Mon, 15 Apr 2019 02:42:45 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lj1-x233.google.com with SMTP id y6so14096994ljd.12; Sun, 14 Apr 2019 19:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UVWvKmRzKXRXH/OufVKUKVXxOeIksECyjNAOPFoyRI4=; b=qtig7QK6NAW/5JhZ5YLxfgGgT5XFQ6J9SoOlJ56pgIgCmH5k9d6VwNmnMWTi4s2uf4 t3bq/cXVM0JgzQPscJgwUTHn4iG88YRV4ZF62F1aVW/3DbXa5YycOMleC0MW7CKhIrG4 vTk3SvUDllNEtsGX/utIWJEvOwAG0Smc1QZsJmu2rTApZPoXZAL41B69PMbBE3gBzmOG hYduxLFxtoHLSNYHcnSqdWtMHQdjuYMYLB+qzqr2xD6WMs3qPa5PezZG8Qjc96A4JN1a SDFnCVARZzOOZLJq/VjxCNSRdV/xD7nUzXPtDQERbQJNZdOyCOPkB8L8Sbio8WO5gcbQ ifmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=UVWvKmRzKXRXH/OufVKUKVXxOeIksECyjNAOPFoyRI4=; b=M1aro9vetTMDU3uQfOgxf2+XNqPV1lA9mkHsGL+Vog6mofnFefv0KK4eP+rPLrYXZB bPZS0ertGkbqN5Tvxeq6R0o5SvXB37EltF7JmCDjMuxPvY0bL+Bg+DXVTp8OgT77ED3M m+Nh9wxlsOqc+m3WhWDW5E8sqcKA2nyZiuZY0nm6CriRrqSwQFfsUx4ItP+czuOVO0RG YPoU4yb+fbdZC/o+HvvMZ4uNk26opsdh3xEn/49jzOK2tCPPiiflBohQ379DMPTr6gUz 4Aus5alVhNwqpB8w+K0Yz7YyAL8OisftL01StvTMtbeeYPwdK6gU7WU46yfOCRZspSsU BkJw== X-Gm-Message-State: APjAAAUYFH/4qRXXyfE1QmSMWHkHiRNDoeUnwXz1wWMkxTzQdfwsLpBO okeUXHEROGsTzaZZS15NSNg= X-Google-Smtp-Source: APXvYqwneG5whVsMuwAgfwxq6YvqaIXWuUiKU+Tiv731m8/hncfEUowqyiGU+bRTOlwH7lc7QlgsGA== X-Received: by 2002:a2e:8ece:: with SMTP id e14mr21496948ljl.66.1555296164199; Sun, 14 Apr 2019 19:42:44 -0700 (PDT) Received: from x-wing (87-206-170-77.dynamic.chello.pl. [87.206.170.77]) by smtp.gmail.com with ESMTPSA id q12sm2228019lfa.37.2019.04.14.19.42.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Apr 2019 19:42:42 -0700 (PDT) Sender: Mariusz Zaborski Date: Mon, 15 Apr 2019 04:42:46 +0200 From: Mariusz Zaborski To: Adrian Chadd Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345875 - in head: contrib/elftoolchain/strings usr.bin/strings Message-ID: <20190415024246.GA36864@x-wing> References: <201904041632.x34GWR4Z006164@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: B93098BEAC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; TAGGED_RCPT(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; TAGGED_FROM(0.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: Mon, 15 Apr 2019 02:42:46 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 14, 2019 at 08:19:22AM -0700, Adrian Chadd wrote: > This exposed a fun bug - gcc mips 6.4.0 complains about an unused arg (fa) > in fileargs_fopen() in the strings change when you compile without casper > support. I do that on mips. >=20 > I have a local change that converts the #define to an inline function so > the unused arg can be (void)'ed away. Mind if I commit it? Sounds good to me. Although you don't have an issue with others services? --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD committer | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 >=20 > On Thu, 4 Apr 2019 at 09:32, Mariusz Zaborski wrote: >=20 > > Author: oshogbo > > Date: Thu Apr 4 16:32:27 2019 > > New Revision: 345875 > > URL: https://svnweb.freebsd.org/changeset/base/345875 > > > > Log: > > strings: capsicumize it > > > > Reviewed by: cem > > Discussed with: emaste > > Differential Revision: https://reviews.freebsd.org/D18038 > > > > Modified: > > head/contrib/elftoolchain/strings/strings.c > > head/usr.bin/strings/Makefile > > > > Modified: head/contrib/elftoolchain/strings/strings.c > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/contrib/elftoolchain/strings/strings.c Thu Apr 4 12:02:48 2019 > > (r345874) > > +++ head/contrib/elftoolchain/strings/strings.c Thu Apr 4 16:32:27 2019 > > (r345875) > > @@ -25,8 +25,10 @@ > > */ > > > > #include > > +#include > > #include > > > > +#include > > #include > > #include > > #include > > @@ -44,6 +46,9 @@ > > #include > > #include > > > > +#include > > +#include > > + > > #include "_elftc.h" > > > > ELFTC_VCSID("$Id: strings.c 3648 2018-11-22 23:26:43Z emaste $"); > > @@ -85,7 +90,7 @@ static struct option strings_longopts[] =3D { > > }; > > > > int getcharacter(FILE *, long *); > > -int handle_file(const char *); > > +int handle_file(fileargs_t *fa, const char *); > > int handle_elf(const char *, FILE *); > > int handle_binary(const char *, FILE *, size_t); > > int find_strings(const char *, FILE *, off_t, off_t); > > @@ -99,6 +104,8 @@ void usage(void); > > int > > main(int argc, char **argv) > > { > > + fileargs_t *fa; > > + cap_rights_t rights; > > int ch, rc; > > > > rc =3D 0; > > @@ -187,27 +194,41 @@ main(int argc, char **argv) > > argc -=3D optind; > > argv +=3D optind; > > > > + cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCN= TL); > > + fa =3D fileargs_init(argc, argv, O_RDONLY, 0, &rights); > > + if (fa =3D=3D NULL) > > + err(1, "Unable to initialize casper fileargs"); > > + > > + caph_cache_catpages(); > > + if (caph_limit_stdio() < 0 && caph_enter_casper() < 0) { > > + fileargs_free(fa); > > + err(1, "Unable to enter capability mode"); > > + } > > + > > if (min_len =3D=3D 0) > > min_len =3D 4; > > if (*argv =3D=3D NULL) > > rc =3D find_strings("{standard input}", stdin, 0, 0); > > else while (*argv !=3D NULL) { > > - if (handle_file(*argv) !=3D 0) > > + if (handle_file(fa, *argv) !=3D 0) > > rc =3D 1; > > argv++; > > } > > + > > + fileargs_free(fa); > > + > > return (rc); > > } > > > > int > > -handle_file(const char *name) > > +handle_file(fileargs_t *fa, const char *name) > > { > > FILE *pfile; > > int rt; > > > > if (name =3D=3D NULL) > > return (1); > > - pfile =3D fopen(name, "rb"); > > + pfile =3D fileargs_fopen(fa, name, "rb"); > > if (pfile =3D=3D NULL) { > > warnx("'%s': %s", name, strerror(errno)); > > return (1); > > > > Modified: head/usr.bin/strings/Makefile > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.bin/strings/Makefile Thu Apr 4 12:02:48 2019 > > (r345874) > > +++ head/usr.bin/strings/Makefile Thu Apr 4 16:32:27 2019 > > (r345875) > > @@ -10,6 +10,12 @@ PROG=3D strings > > > > LIBADD=3D elftc elf > > > > +.if ${MK_CASPER} !=3D "no" && !defined(BOOTSTRAPPING) > > +LIBADD+=3D casper > > +LIBADD+=3D cap_fileargs > > +CFLAGS+=3D -DWITH_CASPER > > +.endif > > + > > CFLAGS+=3D-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common > > > > .include > > > > --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkD1x0xkJXVVY1Gwf38KEGuLGxWQFAlyz758ACgkQ38KEGuLG xWR1Qg/8C64XwBxmWoPJOFc+NN4scD6Pczcy8vBknNSuCK2T3++axg8sLJjiIPuP FmTekAnACu1pZe4WdnirO0mXvB/4sSp/uhvPacGXOhCcfsmgSKuKJIfZt4wqKqrU fv108NyKpLaLXrV9c/8N5Fu7p44aduJxpdkzJcSq0cwTNKOxGVsrDYpfC7o4r0e0 bthYQfhyc9JlMwj75mPTh/DQnwwbpZ6dNodigWSsF4ujvCexjj1pcMefo3IMc88P zYD5hJ9JHZKnIwhbMRpuML4MP1+EHyV3uCxQ1aWekDTltkULzJ8KHaguL+1oWUYL CW9SsnPVcpRmGLK/JOrG5SFnCm2OttIZOnhriMS+LRIhXd+f6J6I5VsgITJbnCbu E+Suo514UOxhInuBODJEGfiUYoJmTM2nOPisNsNE3N/x2ToRW+O1gDA02lL9btRC uSKObJ72FL2Lkmru1LsJz/Z9uGN09o6gSJKrI3DB8QJxlBJeJqUxwNFY8XmAJuaE TRChi7OHQGmH6Ira0s+qUnhFW+jM7hRswe8Q9YD16yKLoY25AQAOn+0ez3BBKqJk LwGa5xQR9M9ItUsvJW2HGYKmhSqHIVtvjsrI1sANWYYUIK/WMIo8TN4ISEsNjpLe 4P6r9mCA8U1ZMt9dm8dMoovh3QShkMELrApJfWZCmX6w+z2QdWw= =ClwG -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- From owner-svn-src-head@freebsd.org Mon Apr 15 03:31:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EF871587C25; Mon, 15 Apr 2019 03:31:03 +0000 (UTC) (envelope-from oshogbo@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 3D0538D882; Mon, 15 Apr 2019 03:31:03 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FF4921EA; Mon, 15 Apr 2019 03:31:03 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3F3V2tb026412; Mon, 15 Apr 2019 03:31:02 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3F3V2kv026411; Mon, 15 Apr 2019 03:31:02 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904150331.x3F3V2kv026411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 15 Apr 2019 03:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346218 - head/lib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libnv X-SVN-Commit-Revision: 346218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D0538D882 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)[-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: Mon, 15 Apr 2019 03:31:03 -0000 Author: oshogbo Date: Mon Apr 15 03:31:02 2019 New Revision: 346218 URL: https://svnweb.freebsd.org/changeset/base/346218 Log: libnv: add support for nvlist_send()/nvlist_recv() on Linux This may be useful for cross build in the feature. Submitted by: Mindaugas Rasiukevicius MFC after: 2 weeks Modified: head/lib/libnv/msgio.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Mon Apr 15 01:27:15 2019 (r346217) +++ head/lib/libnv/msgio.c Mon Apr 15 03:31:02 2019 (r346218) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -58,7 +59,12 @@ __FBSDID("$FreeBSD$"); #define PJDLOG_ABORT(...) abort() #endif +#ifdef __linux__ +/* Linux: arbitrary size, but must be lower than SCM_MAX_FD. */ +#define PKG_MAX_SIZE ((64U - 1) * CMSG_SPACE(sizeof(int))) +#else #define PKG_MAX_SIZE (MCLBYTES / CMSG_SPACE(sizeof(int)) - 1) +#endif static int msghdr_add_fd(struct cmsghdr *cmsg, int fd) @@ -74,31 +80,6 @@ msghdr_add_fd(struct cmsghdr *cmsg, int fd) return (0); } -static int -msghdr_get_fd(struct cmsghdr *cmsg) -{ - int fd; - - if (cmsg == NULL || cmsg->cmsg_level != SOL_SOCKET || - cmsg->cmsg_type != SCM_RIGHTS || - cmsg->cmsg_len != CMSG_LEN(sizeof(fd))) { - errno = EINVAL; - return (-1); - } - - bcopy(CMSG_DATA(cmsg), &fd, sizeof(fd)); -#ifndef MSG_CMSG_CLOEXEC - /* - * If the MSG_CMSG_CLOEXEC flag is not available we cannot set the - * close-on-exec flag atomically, but we still want to set it for - * consistency. - */ - (void) fcntl(fd, F_SETFD, FD_CLOEXEC); -#endif - - return (fd); -} - static void fd_wait(int fd, bool doread) { @@ -157,14 +138,7 @@ msg_send(int sock, const struct msghdr *msg) return (0); } -/* - * MacOS/Linux do not define struct cmsgcred but we need to bootstrap libnv - * when building on non-FreeBSD systems. Since they are not used during - * bootstrap we can just omit these two functions there. - */ -#ifndef __FreeBSD__ -#warning "cred_send() not supported on non-FreeBSD systems" -#else +#ifdef __FreeBSD__ int cred_send(int sock) { @@ -326,29 +300,53 @@ fd_package_recv(int sock, int *fds, size_t nfds) if (msg_recv(sock, &msg) == -1) goto end; - for (i = 0, cmsg = CMSG_FIRSTHDR(&msg); i < nfds && cmsg != NULL; - i++, cmsg = CMSG_NXTHDR(&msg, cmsg)) { - fds[i] = msghdr_get_fd(cmsg); - if (fds[i] < 0) + i = 0; + cmsg = CMSG_FIRSTHDR(&msg); + while (cmsg && i < nfds) { + unsigned int n; + + if (cmsg->cmsg_level != SOL_SOCKET || + cmsg->cmsg_type != SCM_RIGHTS) { + errno = EINVAL; break; + } + n = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); + if (i + n > nfds) { + errno = EINVAL; + break; + } + bcopy(CMSG_DATA(cmsg), fds + i, sizeof(int) * n); + cmsg = CMSG_NXTHDR(&msg, cmsg); + i += n; } if (cmsg != NULL || i < nfds) { - int fd; + unsigned int last; /* * We need to close all received descriptors, even if we have * different control message (eg. SCM_CREDS) in between. */ - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - fd = msghdr_get_fd(cmsg); - if (fd >= 0) - close(fd); + last = i; + for (i = 0; i < last; i++) { + if (fds[i] >= 0) { + close(fds[i]); + } } errno = EINVAL; goto end; } + +#ifndef MSG_CMSG_CLOEXEC + /* + * If the MSG_CMSG_CLOEXEC flag is not available we cannot set the + * close-on-exec flag atomically, but we still want to set it for + * consistency. + */ + for (i = 0; i < nfds; i++) { + (void) fcntl(fds[i], F_SETFD, FD_CLOEXEC); + } +#endif ret = 0; end: From owner-svn-src-head@freebsd.org Mon Apr 15 03:32:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0060C1587C82; Mon, 15 Apr 2019 03:32:02 +0000 (UTC) (envelope-from oshogbo@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 952C18DB98; Mon, 15 Apr 2019 03:32:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A6232241; Mon, 15 Apr 2019 03:32:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3F3W1pf031231; Mon, 15 Apr 2019 03:32:01 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3F3W1Kb031230; Mon, 15 Apr 2019 03:32:01 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904150332.x3F3W1Kb031230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 15 Apr 2019 03:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346219 - head/lib/libnv/tests X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libnv/tests X-SVN-Commit-Revision: 346219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 952C18DB98 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)[-1.000,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: Mon, 15 Apr 2019 03:32:02 -0000 Author: oshogbo Date: Mon Apr 15 03:32:01 2019 New Revision: 346219 URL: https://svnweb.freebsd.org/changeset/base/346219 Log: libnv: extend the tests Add cases for sending file descriptors. Submitted by: Mindaugas Rasiukevicius MFC after: 2 weeks Modified: head/lib/libnv/tests/nvlist_send_recv_test.c Modified: head/lib/libnv/tests/nvlist_send_recv_test.c ============================================================================== --- head/lib/libnv/tests/nvlist_send_recv_test.c Mon Apr 15 03:31:02 2019 (r346218) +++ head/lib/libnv/tests/nvlist_send_recv_test.c Mon Apr 15 03:32:01 2019 (r346219) @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -58,6 +59,7 @@ child(int sock) { nvlist_t *nvl; nvlist_t *empty; + int pfd[2]; nvl = nvlist_create(0); empty = nvlist_create(0); @@ -73,7 +75,16 @@ child(int sock) nvlist_add_string(nvl, "nvlist/string/", ""); nvlist_add_string(nvl, "nvlist/string/x", "x"); nvlist_add_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz"); + nvlist_add_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", STDERR_FILENO); + if (pipe(pfd) == -1) + err(EXIT_FAILURE, "pipe"); + if (write(pfd[1], "test", 4) != 4) + err(EXIT_FAILURE, "write"); + close(pfd[1]); + nvlist_add_descriptor(nvl, "nvlist/descriptor/pipe_rd", pfd[0]); + close(pfd[0]); + nvlist_add_binary(nvl, "nvlist/binary/x", "x", 1); nvlist_add_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")); nvlist_move_nvlist(nvl, "nvlist/nvlist/empty", empty); @@ -91,8 +102,9 @@ parent(int sock) const nvlist_t *cnvl, *empty; const char *name, *cname; void *cookie, *ccookie; - int type, ctype; + int type, ctype, fd; size_t size; + char buf[4]; nvl = nvlist_recv(sock, 0); CHECK(nvlist_error(nvl) == 0); @@ -175,6 +187,15 @@ parent(int sock) name = nvlist_next(nvl, &type, &cookie); CHECK(name != NULL); + CHECK(type == NV_TYPE_DESCRIPTOR); + CHECK(strcmp(name, "nvlist/descriptor/pipe_rd") == 0); + fd = nvlist_get_descriptor(nvl, name); + CHECK(fd_is_valid(fd)); + CHECK(read(fd, buf, sizeof(buf)) == 4); + CHECK(strncmp(buf, "test", sizeof(buf)) == 0); + + name = nvlist_next(nvl, &type, &cookie); + CHECK(name != NULL); CHECK(type == NV_TYPE_BINARY); CHECK(strcmp(name, "nvlist/binary/x") == 0); CHECK(memcmp(nvlist_get_binary(nvl, name, NULL), "x", 1) == 0); @@ -278,6 +299,12 @@ parent(int sock) cname = nvlist_next(cnvl, &ctype, &ccookie); CHECK(cname != NULL); + CHECK(ctype == NV_TYPE_DESCRIPTOR); + CHECK(strcmp(cname, "nvlist/descriptor/pipe_rd") == 0); + CHECK(fd_is_valid(nvlist_get_descriptor(cnvl, cname))); + + cname = nvlist_next(cnvl, &ctype, &ccookie); + CHECK(cname != NULL); CHECK(ctype == NV_TYPE_BINARY); CHECK(strcmp(cname, "nvlist/binary/x") == 0); CHECK(memcmp(nvlist_get_binary(cnvl, cname, NULL), "x", 1) == 0); @@ -359,7 +386,7 @@ int main(void) { - printf("1..136\n"); + printf("1..146\n"); fflush(stdout); send_nvlist(); From owner-svn-src-head@freebsd.org Mon Apr 15 06:33:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74F06158A89F; Mon, 15 Apr 2019 06:33:06 +0000 (UTC) (envelope-from delphij@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 1226A6B910; Mon, 15 Apr 2019 06:33:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 842F04443; Mon, 15 Apr 2019 06:33:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3F6X52W025547; Mon, 15 Apr 2019 06:33:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3F6X5W7025546; Mon, 15 Apr 2019 06:33:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201904150633.x3F6X5W7025546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 15 Apr 2019 06:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346220 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 346220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1226A6B910 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)[-1.000,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, 15 Apr 2019 06:33:06 -0000 Author: delphij Date: Mon Apr 15 06:33:05 2019 New Revision: 346220 URL: https://svnweb.freebsd.org/changeset/base/346220 Log: Don't cast result from malloc(). MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/dir.c Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Mon Apr 15 03:32:01 2019 (r346219) +++ head/sbin/fsck_msdosfs/dir.c Mon Apr 15 06:33:05 2019 (r346220) @@ -115,7 +115,7 @@ newDosDirEntry(void) struct dosDirEntry *de; if (!(de = freede)) { - if (!(de = (struct dosDirEntry *)malloc(sizeof *de))) + if (!(de = malloc(sizeof *de))) return 0; } else freede = de->next; @@ -140,7 +140,7 @@ newDirTodo(void) struct dirTodoNode *dt; if (!(dt = freedt)) { - if (!(dt = (struct dirTodoNode *)malloc(sizeof *dt))) + if (!(dt = malloc(sizeof *dt))) return 0; } else freedt = dt->next; From owner-svn-src-head@freebsd.org Mon Apr 15 13:03:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7256C15738AE; Mon, 15 Apr 2019 13:03:11 +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 14BF4804EE; Mon, 15 Apr 2019 13:03:11 +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 DCB448626; Mon, 15 Apr 2019 13:03: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 x3FD3A5U031076; Mon, 15 Apr 2019 13:03:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FD3As2031072; Mon, 15 Apr 2019 13:03:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904151303.x3FD3As2031072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Apr 2019 13:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346225 - in head: lib/libc/stdlib libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/stdlib libexec/rtld-elf X-SVN-Commit-Revision: 346225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14BF4804EE 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_SHORT(-0.97)[-0.971,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)[-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: Mon, 15 Apr 2019 13:03:11 -0000 Author: kib Date: Mon Apr 15 13:03:09 2019 New Revision: 346225 URL: https://svnweb.freebsd.org/changeset/base/346225 Log: Fix order of destructors between main binary and libraries. Since inits for the main binary are run from rtld (for some time), the rtld_exit atexit(3) handler, which is passed from rtld to the program entry and installed by csu, is installed after any atexit(3) handlers installed by main binary constructors. This means that rtld_exit() is fired before main binary handlers. Typical C++ static constructors are executed from init (either binary or libs) but use atexit(3) to ensure that destructors are called in the right order, independent of the linking order. Also, C++ libraries finalizers call __cxa_finalize(3) to flush library' atexit(3) entries. Since atexit(3) entry is cleared after being run, this would be mostly innocent, except that, atexit(rtld_exit) done after main binary constructors, makes destructors from libraries executed before destructors for main. Fix by reordering atexit(rtld_exit) before inits for main binary, same as it happened when inits were called by csu. Do it using new private libc symbol with pre-defined ABI. Reported. tested, and reviewed by: kan Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/atexit.c head/libexec/rtld-elf/rtld.c Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Mon Apr 15 12:24:19 2019 (r346224) +++ head/lib/libc/stdlib/Symbol.map Mon Apr 15 13:03:09 2019 (r346225) @@ -129,4 +129,5 @@ FBSDprivate_1.0 { _system; __libc_system; __cxa_thread_call_dtors; + __libc_atexit; }; Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Mon Apr 15 12:24:19 2019 (r346224) +++ head/lib/libc/stdlib/atexit.c Mon Apr 15 13:03:09 2019 (r346225) @@ -142,6 +142,7 @@ atexit(void (*func)(void)) error = atexit_register(&fn); return (error); } +__weak_reference(atexit, __libc_atexit); /** * Register a block to be performed at exit. Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Apr 15 12:24:19 2019 (r346224) +++ head/libexec/rtld-elf/rtld.c Mon Apr 15 13:03:09 2019 (r346225) @@ -151,6 +151,7 @@ static int rtld_dirname(const char *, char *); static int rtld_dirname_abs(const char *, char *); static void *rtld_dlopen(const char *name, int fd, int mode); static void rtld_exit(void); +static void rtld_nop_exit(void); static char *search_library_path(const char *, const char *, const char *, int *); static char *search_library_pathfds(const char *, const char *, int *); @@ -295,6 +296,8 @@ const char *ld_path_rtld = _PATH_RTLD; const char *ld_standard_library_path = STANDARD_LIBRARY_PATH; const char *ld_env_prefix = LD_; +static void (*rtld_exit_ptr)(void); + /* * Fill in a DoneList with an allocation large enough to hold all of * the currently-loaded objects. Keep this as a macro since it calls @@ -756,6 +759,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr *ld_bind_now != '\0', SYMLOOK_EARLY, &lockstate) == -1) rtld_die(); + rtld_exit_ptr = rtld_exit; if (obj_main->crt_no_init) preinit_main(); objlist_call_init(&initlist, &lockstate); @@ -778,7 +782,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr dbg("transferring control to program entry point = %p", obj_main->entry); /* Return the exit procedure and the program entry point. */ - *exit_proc = rtld_exit; + *exit_proc = rtld_exit_ptr; *objp = obj_main; return (func_ptr_type) obj_main->entry; } @@ -2662,6 +2666,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockst Obj_Entry *obj; char *saved_msg; Elf_Addr *init_addr; + void (*reg)(void (*)(void)); int index; /* @@ -2690,7 +2695,16 @@ objlist_call_init(Objlist *list, RtldLockState *lockst */ elm->obj->init_done = true; hold_object(elm->obj); + reg = NULL; + if (elm->obj == obj_main && obj_main->crt_no_init) { + reg = (void (*)(void (*)(void)))get_program_var_addr( + "__libc_atexit", lockstate); + } lock_release(rtld_bind_lock, lockstate); + if (reg != NULL) { + reg(rtld_exit); + rtld_exit_ptr = rtld_nop_exit; + } /* * It is legal to have both DT_INIT and DT_INIT_ARRAY defined. @@ -3002,6 +3016,11 @@ rtld_exit(void) if (!libmap_disable) lm_fini(); lock_release(rtld_bind_lock, &lockstate); +} + +static void +rtld_nop_exit(void) +{ } /* From owner-svn-src-head@freebsd.org Mon Apr 15 13:41:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7338615747F9; Mon, 15 Apr 2019 13:41:55 +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 153B98227C; Mon, 15 Apr 2019 13:41:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC08B8CA9; Mon, 15 Apr 2019 13:41:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3FDfsIV051688; Mon, 15 Apr 2019 13:41:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FDfslJ051685; Mon, 15 Apr 2019 13:41:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904151341.x3FDfslJ051685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Apr 2019 13:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346228 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 346228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 153B98227C 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)[-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: Mon, 15 Apr 2019 13:41:55 -0000 Author: emaste Date: Mon Apr 15 13:41:53 2019 New Revision: 346228 URL: https://svnweb.freebsd.org/changeset/base/346228 Log: Add quirk for ignoring SPCR AccessWidth values on the PL011 UART The SPCR table on the Lenovo HR330A Ampere eMAG server indicates 8-bit access, but 32-bit access is required for the PL011 to work. PL011 on SBSA platforms always supports 32-bit access (and that was hardcoded here before my EC2 fix), let's use 32-bit access for PL011 and 32BIT interface types. Tested by emaste on Ampere eMAG and Cavium/Marvell ThunderX2. Submitted by: Greg V Reviewed by: andrew, imp (earlier) Differential Revision: https://reviews.freebsd.org/D19507 Modified: head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_cpu_arm64.c head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Mon Apr 15 13:12:54 2019 (r346227) +++ head/sys/dev/uart/uart_bus.h Mon Apr 15 13:41:53 2019 (r346228) @@ -57,7 +57,8 @@ #define UART_IOCTL_BAUD 4 /* UART quirk flags */ -#define UART_F_BUSY_DETECT 0x1 +#define UART_F_BUSY_DETECT 0x1 +#define UART_F_IGNORE_SPCR_REGSHFT 0x2 /* * UART class & instance (=softc) Modified: head/sys/dev/uart/uart_cpu_arm64.c ============================================================================== --- head/sys/dev/uart/uart_cpu_arm64.c Mon Apr 15 13:12:54 2019 (r346227) +++ head/sys/dev/uart/uart_cpu_arm64.c Mon Apr 15 13:41:53 2019 (r346228) @@ -153,6 +153,11 @@ uart_cpu_acpi_probe(struct uart_class **classp, bus_sp *shiftp = spcr->SerialPort.AccessWidth - 1; *iowidthp = spcr->SerialPort.BitWidth / 8; + if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) == + UART_F_IGNORE_SPCR_REGSHFT) { + *shiftp = cd->cd_regshft; + } + out: acpi_unmap_table(spcr); return (err); Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Mon Apr 15 13:12:54 2019 (r346227) +++ head/sys/dev/uart/uart_dev_pl011.c Mon Apr 15 13:41:53 2019 (r346228) @@ -342,8 +342,9 @@ UART_FDT_CLASS_AND_DEVICE(fdt_compat_data); #ifdef DEV_ACPI static struct acpi_uart_compat_data acpi_compat_data[] = { - {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011, 2, 0, 0, 0, "uart plo11"}, - {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC, 2, 0, 0, 0, "uart plo11"}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011, 2, 0, 0, UART_F_IGNORE_SPCR_REGSHFT, "uart pl011"}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC, 2, 0, 0, UART_F_IGNORE_SPCR_REGSHFT, "uart pl011"}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_32BIT, 2, 0, 0, UART_F_IGNORE_SPCR_REGSHFT, "uart pl011"}, {NULL, NULL, 0, 0, 0, 0, 0, NULL}, }; UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); From owner-svn-src-head@freebsd.org Mon Apr 15 14:32:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B26CA15755C0; Mon, 15 Apr 2019 14:32:20 +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 5594283BF6; Mon, 15 Apr 2019 14:32:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 112DA955A; Mon, 15 Apr 2019 14:32:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3FEWJIq078621; Mon, 15 Apr 2019 14:32:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FEWJGO078620; Mon, 15 Apr 2019 14:32:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904151432.x3FEWJGO078620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Apr 2019 14:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346229 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 346229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5594283BF6 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.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Mon, 15 Apr 2019 14:32:20 -0000 Author: hselasky Date: Mon Apr 15 14:32:19 2019 New Revision: 346229 URL: https://svnweb.freebsd.org/changeset/base/346229 Log: Fix spelling. Submitted by: Dmitry Luhtionov MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Apr 15 13:41:53 2019 (r346228) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Apr 15 14:32:19 2019 (r346229) @@ -181,7 +181,7 @@ ehci_pci_match(device_t self) case 0x8d2d8086: return ("Intel Wellsburg USB 2.0 controller"); case 0x9c268086: - return ("Intel Lynx Point LP USB 2.0 controller USB"); + return ("Intel Lynx Point-LP USB 2.0 controller USB"); case 0x00e01033: return ("NEC uPD 72010x USB 2.0 controller"); From owner-svn-src-head@freebsd.org Mon Apr 15 15:33:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92AAD1576EE8 for ; Mon, 15 Apr 2019 15:33:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0208C86459 for ; Mon, 15 Apr 2019 15:33:10 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555341420; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=M2K28/+2ojCZJedOmeYvEtdOqKqtgr5oR18VkR4R8Q0m9KmDxqRv/HeyG8mLwtSM9zRN87D/u49W4 uX2/2slUpbPyeyczBJGog1O4GgawE/pMmi2qleB0T4/7nmKFdW6rTFfrnkXtZZt3D7bPMmsu6iTWtz fWkbP1VnxGzUeSyDuWg++JxWs+6BieJfLNuqEMg7KR31tvjLILsG9MoBaCuAN6IuCc02rwoLAor8fV z5PaBdrxpYyEtip9BH4rjTTvXn6Ygnj7BBnMZCz3L/K3v7KfM+IpfRX3PKSOvOJ6WIA4GWG2a/A3ob 72FH6se2r73S2fsKl1E4gFLQgwEnPmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=09IfUBE5Q80BU6BoxJIVaIsJrTbq5kMDO1OzWX+fweI=; b=PC8UOsxsp5b1CatHYsM6ILUT3RSSq7J3pnpdj5cvCtX97RGn8ZLQyvV3Ov+Q8Mvv3AqDo9CUKscNT x9JPMG4wJqybikdCyM9Ds/sYJqF2exm38FriQjC8uITaREkO2N3yKm2atnThh6s/xLUTJVjbORUZzt JhCv9yG4r1BZa1DcwYcYG4CcBozObgS1hyXuir0KRwxDVEALGz6/eSj9mm/i2I1wpvCY+o0SOP7m8M iWlMtAmiXbT0eWfcz/X6qQ20Jd+SbZTLgKt9kG8Ae5DkBNnRMl7lEhFPiRpqezNkwqWZUQlh971Vcv jKsWVqIUyFGLb8opfb8xIwGjHCfupEg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=09IfUBE5Q80BU6BoxJIVaIsJrTbq5kMDO1OzWX+fweI=; b=OAv0OfssZJFrp/yEHAwWCWyvUWNPtkmnQGWuavLmgFh6/hJ/vHZDUeeSnBF75O5e7FpTMEFCek91Z R7d+NpahjeGnavEN6Td9oJXQJeJ8I+WypLEpZvX1dIWT9bR57mSZkuAqc2oyrqTAxC17hsqkspSfUt BchhEEsLo+D3yMkrFer/qvpYYcIZf59390EebBpLLM6hjg6hOMbWNxBiKNiMRIj+cACFIAfsTZowdX eG03Zk7xh0thl4/Fj7AyPQBJrtqxP/8JpZWlxL89vOndHz5jPM90w5rZkOiNyEjHNd+mLs+6Fze//f 6uytCCFzRqQLge0yzutJlVq47SAbW+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: 82ca62ea-5f91-11e9-919f-112c64a8cf29 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 82ca62ea-5f91-11e9-919f-112c64a8cf29; Mon, 15 Apr 2019 15:16:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3FFGv6i039357; Mon, 15 Apr 2019 09:16:57 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <39cdbdfbedfce8f2f45ed5be0511d3a8b8f9720a.camel@freebsd.org> Subject: Re: svn commit: r346096 - head/sys/arm/conf From: Ian Lepore To: Svatopluk Kraus , Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 15 Apr 2019 09:16:57 -0600 In-Reply-To: References: <201904101927.x3AJREvt013138@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0208C86459 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.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, 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, 15 Apr 2019 15:33:11 -0000 On Thu, 2019-04-11 at 21:23 +0200, Svatopluk Kraus wrote: > I understand the reason for GENERIC. But are we so blind that we will > delete everything that is not GENERIC? In other words, why to delete > nice specific KERNEL configurations for boards we support when only > reason I see is that GENERIC is so cool for some people? > > Svatopluk Kraus > > I completely agree with this. We had a plan for removing board- specific configs that had been rolled into GENERIC, and it did not involve just deleting them without providing any alternative to people who have custom configs based on them. That plan's execution has stalled, but that's not a good reason for this abrupt deletion without any warning. I think these deletions fall into two categories: 1. Configs for hardware that isn't adequately supported anymore. 2. Configs for popular supported hardware which can use GENERIC. We need to figure out which ones count as #2 and restore them until we've implemented our original plan for phasing them out. I think those would be: BEAGLEBONE PANDABOARD RPI2 For the others, we need to evaluate: if we are removing the only config file that refers to some chunks of sys/arm code, shouldn't we be removing that code too? For example, removing AML8726 probably implies that all of arm/amlogic/* can be deleted. -- Ian > > On Wed, Apr 10, 2019 at 9:27 PM Emmanuel Vadot > wrote: > > > > Author: manu > > Date: Wed Apr 10 19:27:14 2019 > > New Revision: 346096 > > URL: https://svnweb.freebsd.org/changeset/base/346096 > > > > Log: > > arm: kernel: Remove old kernel configs > > > > Follow up to r346095 > > All those kernels are either not working or the release have > > switched > > to GENERIC > > > > Deleted: > > head/sys/arm/conf/AML8726 > > head/sys/arm/conf/BEAGLEBONE > > head/sys/arm/conf/CHROMEBOOK > > head/sys/arm/conf/CHROMEBOOK-PEACH-PIT > > head/sys/arm/conf/CHROMEBOOK-PEACH-PIT.hints > > head/sys/arm/conf/CHROMEBOOK-SNOW > > head/sys/arm/conf/CHROMEBOOK-SPRING > > head/sys/arm/conf/CHROMEBOOK.hints > > head/sys/arm/conf/EXYNOS5.common > > head/sys/arm/conf/EXYNOS5250 > > head/sys/arm/conf/EXYNOS5420 > > head/sys/arm/conf/ODROIDC1 > > head/sys/arm/conf/PANDABOARD > > head/sys/arm/conf/PANDABOARD.hints > > head/sys/arm/conf/RADXA > > head/sys/arm/conf/RADXA-LITE > > head/sys/arm/conf/RK3188 > > head/sys/arm/conf/RPI2 > > > > From owner-svn-src-head@freebsd.org Mon Apr 15 17:14:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 166B515792F6; Mon, 15 Apr 2019 17:14:52 +0000 (UTC) (envelope-from gallatin@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 B14558A53A; Mon, 15 Apr 2019 17:14:51 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E58EB0F7; Mon, 15 Apr 2019 17:14:51 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3FHEp1K065060; Mon, 15 Apr 2019 17:14:51 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FHEpDM065058; Mon, 15 Apr 2019 17:14:51 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201904151714.x3FHEpDM065058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 15 Apr 2019 17:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346247 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 346247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B14558A53A 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 15 Apr 2019 17:14:52 -0000 Author: gallatin Date: Mon Apr 15 17:14:50 2019 New Revision: 346247 URL: https://svnweb.freebsd.org/changeset/base/346247 Log: mlx5en: Enable new pfil(9) KPI ethernet filtering hooks This allows efficient filtering at packet ingress on mlx5en. Note that the packets are filtered (and potentially dropped) *before* the driver has committed to (re)allocating an mbuf for the packet. Dropped packets are treated essentially the same as an error. Nothing is allocated, and the existing buffer is recycled. This allows us to drop malicious packets at close to line rate with very little CPU use. Reviewed by: hselasky, slavash, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19063 Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Mon Apr 15 16:57:27 2019 (r346246) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Apr 15 17:14:50 2019 (r346247) @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -838,6 +839,7 @@ struct mlx5e_priv { struct mlx5e_clbr_point clbr_points[2]; u_int clbr_gen; + struct pfil_head *pfil; struct mlx5e_channel channel[]; }; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Apr 15 16:57:27 2019 (r346246) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Apr 15 17:14:50 2019 (r346247) @@ -3664,6 +3664,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) struct sysctl_oid_list *child; int ncv = mdev->priv.eq_table.num_comp_vectors; char unit[16]; + struct pfil_head_args pa; int err; int i; u32 eth_proto_cap; @@ -3898,6 +3899,12 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) callout_init(&priv->tstmp_clbr, CALLOUT_DIRECT); mlx5e_reset_calibration_callout(priv); + pa.pa_version = PFIL_VERSION; + pa.pa_flags = PFIL_IN; + pa.pa_type = PFIL_TYPE_ETHERNET; + pa.pa_headname = ifp->if_xname; + priv->pfil = pfil_head_register(&pa); + return (priv); #ifdef RATELIMIT @@ -3972,6 +3979,12 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp if_printf(priv->ifp, "Waiting for all unlimited connections " "to terminate\n"); pause("W", hz); + } + + /* deregister pfil */ + if (priv->pfil != NULL) { + pfil_head_unregister(priv->pfil); + priv->pfil = NULL; } /* unregister device */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Apr 15 16:57:27 2019 (r346246) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Apr 15 17:14:50 2019 (r346247) @@ -430,15 +430,18 @@ mlx5e_decompress_cqes(struct mlx5e_cq *cq) static int mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) { - int i; + struct pfil_head *pfil; + int i, rv; + CURVNET_SET_QUIET(rq->ifp->if_vnet); + pfil = rq->channel->priv->pfil; for (i = 0; i < budget; i++) { struct mlx5e_rx_wqe *wqe; struct mlx5_cqe64 *cqe; struct mbuf *mb; __be16 wqe_counter_be; u16 wqe_counter; - u32 byte_cnt; + u32 byte_cnt, seglen; cqe = mlx5e_get_cqe(&rq->cq); if (!cqe) @@ -462,6 +465,39 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) rq->stats.wqe_err++; goto wq_ll_pop; } + if (pfil != NULL && PFIL_HOOKED_IN(pfil)) { + seglen = MIN(byte_cnt, MLX5E_MAX_RX_BYTES); + rv = pfil_run_hooks(rq->channel->priv->pfil, + rq->mbuf[wqe_counter].data, rq->ifp, + seglen | PFIL_MEMPTR | PFIL_IN, NULL); + + switch (rv) { + case PFIL_DROPPED: + case PFIL_CONSUMED: + /* + * Filter dropped or consumed it. In + * either case, we can just recycle + * buffer; there is no more work to do. + */ + rq->stats.packets++; + goto wq_ll_pop; + case PFIL_REALLOCED: + /* + * Filter copied it; recycle buffer + * and receive the new mbuf allocated + * by the Filter + */ + mb = pfil_mem2mbuf(rq->mbuf[wqe_counter].data); + goto rx_common; + default: + /* + * The Filter said it was OK, so + * receive like normal. + */ + KASSERT(rv == PFIL_PASS, + ("Filter returned %d!\n", rv)); + } + } if ((MHLEN - MLX5E_NET_IP_ALIGN) >= byte_cnt && (mb = m_gethdr(M_NOWAIT, MT_DATA)) != NULL) { #if (MLX5E_MAX_RX_SEGS != 1) @@ -480,7 +516,7 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) bus_dmamap_unload(rq->dma_tag, rq->mbuf[wqe_counter].dma_map); } - +rx_common: mlx5e_build_rx_mbuf(cqe, rq, mb, byte_cnt); rq->stats.bytes += byte_cnt; rq->stats.packets++; @@ -499,6 +535,7 @@ wq_ll_pop: mlx5_wq_ll_pop(&rq->wq, wqe_counter_be, &wqe->next.next_wqe_index); } + CURVNET_RESTORE(); mlx5_cqwq_update_db_record(&rq->cq.wq); From owner-svn-src-head@freebsd.org Mon Apr 15 17:32:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACEF1579AD7; Mon, 15 Apr 2019 17:32:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 C29998AFF0; Mon, 15 Apr 2019 17:32:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B06C1B465; Mon, 15 Apr 2019 17:32:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3FHWckA075968; Mon, 15 Apr 2019 17:32:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FHWcb9075967; Mon, 15 Apr 2019 17:32:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904151732.x3FHWcb9075967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Apr 2019 17:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346248 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 346248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C29998AFF0 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Mon, 15 Apr 2019 17:32:39 -0000 Author: hselasky Date: Mon Apr 15 17:32:38 2019 New Revision: 346248 URL: https://svnweb.freebsd.org/changeset/base/346248 Log: Remove superfluous USB keyword. Discussed with: danfe@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Apr 15 17:14:50 2019 (r346247) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Apr 15 17:32:38 2019 (r346248) @@ -181,7 +181,7 @@ ehci_pci_match(device_t self) case 0x8d2d8086: return ("Intel Wellsburg USB 2.0 controller"); case 0x9c268086: - return ("Intel Lynx Point-LP USB 2.0 controller USB"); + return ("Intel Lynx Point-LP USB 2.0 controller"); case 0x00e01033: return ("NEC uPD 72010x USB 2.0 controller"); From owner-svn-src-head@freebsd.org Mon Apr 15 18:40:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 893F2157AE56; Mon, 15 Apr 2019 18:40:38 +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 356C58D333; Mon, 15 Apr 2019 18:40:38 +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 20AC3C183; Mon, 15 Apr 2019 18:40:38 +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 x3FIecJY009253; Mon, 15 Apr 2019 18:40:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FIeaEQ009242; Mon, 15 Apr 2019 18:40:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904151840.x3FIeaEQ009242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 15 Apr 2019 18:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys X-SVN-Commit-Revision: 346250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 356C58D333 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)[-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: Mon, 15 Apr 2019 18:40:38 -0000 Author: cem Date: Mon Apr 15 18:40:36 2019 New Revision: 346250 URL: https://svnweb.freebsd.org/changeset/base/346250 Log: random(4): Block read_random(9) on initial seeding read_random() is/was used, mostly without error checking, in a lot of very sensitive places in the kernel -- including seeding the widely used arc4random(9). Most uses, especially arc4random(9), should block until the device is seeded rather than proceeding with a bogus or empty seed. I did not spy any obvious kernel consumers where blocking would be inappropriate (in the sense that lack of entropy would be ok -- I did not investigate locking angle thoroughly). In many instances, arc4random_buf(9) or that family of APIs would be more appropriate anyway; that work was done in r345865. A minor cleanup was made to the implementation of the READ_RANDOM function: instead of using a variable-length array on the stack to temporarily store all full random blocks sufficient to satisfy the requested 'len', only store a single block on the stack. This has some benefit in terms of reducing stack usage, reducing memcpy overhead and reducing devrandom output leakage via the stack. Additionally, the stack block is now safely zeroed if it was used. One caveat of this change is that the kern.arandom sysctl no longer returns zero bytes immediately if the random device is not seeded. This means that FreeBSD-specific userspace applications which attempted to handle an unseeded random device may be broken by this change. If such behavior is needed, it can be replaced by the more portable getrandom(2) GRND_NONBLOCK option. On any typical FreeBSD system, entropy is persisted on read/write media and used to seed the random device very early in boot, and blocking is never a problem. This change primarily impacts the behavior of /dev/random on embedded systems with read-only media that do not configure "nodevice random". We toggle the default from 'charge on blindly with no entropy' to 'block indefinitely.' This default is safer, but may cause frustration. Embedded system designers using FreeBSD have several options. The most obvious is to plan to have a small writable NVRAM or NAND to persist entropy, like larger systems. Early entropy can be fed from any loader, or by writing directly to /dev/random during boot. Some embedded SoCs now provide a fast hardware entropy source; this would also work for quickly seeding Fortuna. A 3rd option would be creating an embedded-specific, more simplistic random module, like that designed by DJB in [1] (this design still requires a small rewritable media for forward secrecy). Finally, the least preferred option might be "nodevice random", although I plan to remove this in a subsequent revision. To help developers emulate the behavior of these embedded systems on ordinary workstations, the tunable kern.random.block_seeded_status was added. When set to 1, it blocks the random device. I attempted to document this change in random.4 and random.9 and ran into a bunch of out-of-date or irrelevant or inaccurate content and ended up rototilling those documents more than I intended to. Sorry. I think they're in a better state now. PR: 230875 Reviewed by: delphij, markm (earlier version) Approved by: secteam(delphij), devrandom(markm) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19744 Modified: head/share/man/man4/random.4 head/share/man/man9/random.9 head/sys/dev/random/fortuna.c head/sys/dev/random/random_harvestq.c head/sys/dev/random/random_infra.c head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/kern/kern_mib.c head/sys/libkern/arc4random.c head/sys/sys/random.h Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Mon Apr 15 17:54:40 2019 (r346249) +++ head/share/man/man4/random.4 Mon Apr 15 18:40:36 2019 (r346250) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 26, 2018 +.Dd April 15, 2019 .Dt RANDOM 4 .Os .Sh NAME @@ -32,63 +32,44 @@ .Sh SYNOPSIS .Cd "device random" .Cd "options RANDOM_LOADABLE" +.Cd "options RANDOM_ENABLE_ETHER" .Cd "options RANDOM_ENABLE_UMA" .Sh DESCRIPTION The .Nm -device -returns an endless supply of random bytes when read. -It also accepts and reads data -as any ordinary file. +device returns an endless supply of random bytes when read. .Pp The generator will start in an .Em unseeded -state, and will block reads until -it is seeded for the first time. -This may cause trouble at system boot -when keys and the like -are generated from -.Nm -so steps should be taken to ensure a -seeding as soon as possible. +state, and will block reads until it is seeded for the first time. .Pp -It is also possible -to read random bytes -by using the KERN_ARND sysctl. -On the command line -this could be done by +To provide prompt access to the random device at boot time, +.Fx +automatically persists some entropy data in +.Pa /boot/entropy +for the loader to provide to the kernel. +Additional entropy is regularly saved in +.Pa /var/db/entropy . +This saved entropy is sufficient to unblock the random device on devices with +writeable media. .Pp -.Dl "sysctl -x -B 16 kern.arandom" +Embedded applications without writable media must determine their own scheme +for re-seeding the random device on boot, or accept that the device +will remain unseeded and block reads indefinitely. +See +.Sx SECURITY CONSIDERATIONS +for more detail. .Pp -This sysctl will not return -random bytes unless -the -.Nm -device is seeded. +In addition to +.Xr read 2 , +the direct output of the abstract kernel entropy device can be read with +.Xr getrandom 2 , +.Xr getentropy 3 , +or the +.Xr sysctl 8 +pseudo-variable +.Va kern.arandom . .Pp -This initial seeding -of random number generators -is a bootstrapping problem -that needs very careful attention. -In some cases, -it may be difficult -to find enough randomness -to seed a random number generator -until a system is fully operational, -but the system requires random numbers -to become fully operational. -It is (or more accurately should be) -critically important that the -.Nm -device is seeded -before the first time it is used. -In the case where a dummy or "blocking-only" -device is used, -it is the responsibility -of the system architect -to ensure that no blocking reads -hold up critical processes. -.Pp To see the current settings of the software .Nm device, use the command line: @@ -97,17 +78,20 @@ device, use the command line: .Pp which results in something like: .Bd -literal -offset indent +kern.random.block_seeded_status: 0 kern.random.fortuna.minpoolsize: 64 -kern.random.harvest.mask_symbolic: [HIGH_PERFORMANCE], ... ,CACHED -kern.random.harvest.mask_bin: 00111111111 -kern.random.harvest.mask: 511 +kern.random.harvest.mask_symbolic: ENABLEDSOURCE,[DISABLEDSOURCE],...,CACHED +kern.random.harvest.mask_bin: 00000010000000111011111 +kern.random.harvest.mask: 66015 +kern.random.use_chacha20_cipher: 0 kern.random.random_sources: 'Intel Secure Key RNG' .Ed .Pp Other than -.Dl kern.random.fortuna.minpoolsize +.Va kern.random.block_seeded_status , +.Va kern.random.fortuna.minpoolsize , and -.Dl kern.random.harvest.mask +.Va kern.random.harvest.mask , all settings are read-only. .Pp The @@ -137,17 +121,66 @@ and .Va kern.random.harvest.mask_symbolic sysctls can be used to confirm -that the choices are correct. -Note that disabled items +settings in a human readable form. +Disabled items in the latter item are listed in square brackets. See .Xr random_harvest 9 for more on the harvesting of entropy. +.Sh FILES +.Bl -tag -width ".Pa /dev/urandom" +.It Pa /dev/random +.It Pa /dev/urandom +.El +.Sh SEE ALSO +.Xr getrandom 2 , +.Xr arc4random 3 , +.Xr getentropy 3 , +.Xr random 3 , +.Xr sysctl 8 , +.Xr random 9 +.Rs +.%A Ferguson +.%A Schneier +.%A Kohno +.%B Cryptography Engineering +.%I Wiley +.%O ISBN 978-0-470-47424-2 +.Re +.Sh HISTORY +A +.Nm +device appeared in +.Fx 2.2 . +The implementation was changed to the +.Em Yarrow algorithm in +.Fx 5.0 . +In +.Fx 11.0 , +the Fortuna algorithm was introduced as the default. +In +.Fx 12.0 , +Yarrow was removed entirely. +.Sh AUTHORS +.An -nosplit +The current +.Nm +code was authored by +.An Mark R V Murray , +with significant contributions from many people. .Pp +The +.Em Fortuna +algorithm was designed by +.An Niels Ferguson , +.An Bruce Schneier , +and +.An Tadayoshi Kohno . +.Sh CAVEATS When .Cd "options RANDOM_LOADABLE" -is used, +is enabled, the .Pa /dev/random device is not created @@ -155,13 +188,9 @@ until an "algorithm module" is loaded. The only module built by default is .Em random_fortuna . -The -.Em random_yarrow -module was removed in -.Fx 12 . -Note that this loadable module -is slightly less efficient -than its compiled-in equivalent. +Loadable random modules +are less efficient +than their compiled-in equivalents. This is because some functions must be locked against load and unload events, @@ -170,174 +199,40 @@ to allow for removal. .Pp When .Cd "options RANDOM_ENABLE_UMA" -is used, +is enabled, the .Pa /dev/random device will obtain entropy from the zone allocator. -This is potentially very high rate, -and if so will be of questionable use. -If this is the case, -use of this option -is not recommended. -Determining this is not trivial, -so experimenting and measurement -using tools such as -.Xr dtrace 1 -will be required. -.Sh RANDOMNESS -The use of randomness in the field of computing -is a rather subtle issue because randomness means -different things to different people. -Consider generating a password randomly, -simulating a coin tossing experiment or -choosing a random back-off period when a server does not respond. -Each of these tasks requires random numbers, -but the random numbers in each case have different requirements. +This is a very high rate source with significant performance impact. +Therefore, it is disabled by default. .Pp -Generation of passwords, session keys and the like -requires cryptographic randomness. -A cryptographic random number generator should be designed -so that its output is difficult to guess, -even if a lot of auxiliary information is known -(such as when it was seeded, subsequent or previous output, and so on). -On -.Fx , -seeding for cryptographic random number generators is provided by the +When +.Cd "options RANDOM_ENABLE_ETHER" +is enabled, the .Nm -device, -which provides real randomness. -The -.Xr arc4random 3 -library call provides a pseudo-random sequence -which is generally reckoned to be suitable for -simple cryptographic use. -The OpenSSL library also provides functions for managing randomness -via functions such as -.Xr RAND_bytes 3 -and -.Xr RAND_add 3 . -Note that OpenSSL uses the -.Nm -device for seeding automatically. +device will obtain entropy from +.Vt mbuf +structures passing through the network stack. +This source is both extremely expensive and a poor source of entropy, so it is +disabled by default. +.Sh SECURITY CONSIDERATIONS +The initial seeding +of random number generators +is a bootstrapping problem +that needs very careful attention. +When writable media is available, the +.Em Fortuna +paper describes a robust system for rapidly reseeding the device. .Pp -Randomness for simulation is required in engineering or -scientific software and games. -The first requirement of these applications is -that the random numbers produced conform to some well-known, -usually uniform, distribution. -The sequence of numbers should also appear numerically uncorrelated, -as simulation often assumes independence of its random inputs. -Often it is desirable to reproduce -the results of a simulation exactly, -so that if the generator is seeded in the same way, -it should produce the same results. -A peripheral concern for simulation is -the speed of a random number generator. +In some embedded cases, it may be difficult to find enough randomness to seed a +random number generator until a system is fully operational. +In these cases, is the responsibility of the system architect to ensure that +blocking is acceptable, or that the random device is seeded. +(This advice does not apply to typical consumer systems.) .Pp -Another issue in simulation is -the size of the state associated with the random number generator, and -how frequently it repeats itself. -For example, -a program which shuffles a pack of cards should have 52!\& possible outputs, -which requires the random number generator to have 52!\& starting states. -This means the seed should have at least log_2(52!) ~ 226 bits of state -if the program is to stand a chance of outputting all possible sequences, -and the program needs some unbiased way of generating these bits. -Again, -the +To emulate embedded systems, developers may set the +.Va kern.random.block_seeded_status +tunable to 1 to verify boot does not require early availability of the .Nm -device could be used for seeding here, -but in practice, smaller seeds are usually considered acceptable. -.Pp -.Fx -provides two families of functions which are considered -suitable for simulation. -The -.Xr random 3 -family of functions provides a random integer -between 0 to -.if t 2\u\s731\s10\d\(mi1. -.if n (2**31)\(mi1. -The functions -.Xr srandom 3 , -.Xr initstate 3 -and -.Xr setstate 3 -are provided for deterministically setting -the state of the generator and -the function -.Xr srandomdev 3 -is provided for setting the state via the -.Nm device. -The -.Xr drand48 3 -family of functions are also provided, -which provide random floating point numbers in various ranges. -.Pp -Randomness that is used for collision avoidance -(for example, in certain network protocols) -has slightly different semantics again. -It is usually expected that the numbers will be uniform, -as this produces the lowest chances of collision. -Here again, -the seeding of the generator is very important, -as it is required that different instances of -the generator produce independent sequences. -However, the guessability or reproducibility of the sequence is unimportant, -unlike the previous cases. -.Pp -.Fx -does also provide the traditional -.Xr rand 3 -library call, -for compatibility purposes. -However, -it is known to be poor for simulation and -absolutely unsuitable for cryptographic purposes, -so its use is discouraged. -.Sh FILES -.Bl -tag -width ".Pa /dev/random" -.It Pa /dev/random -.El -.Sh SEE ALSO -.Xr arc4random 3 , -.Xr drand48 3 , -.Xr rand 3 , -.Xr RAND_add 3 , -.Xr RAND_bytes 3 , -.Xr random 3 , -.Xr sysctl 8 , -.Xr random 9 -.Rs -.%A Ferguson -.%A Schneier -.%A Kohno -.%B Cryptography Engineering -.%I Wiley -.%O ISBN 978-0-470-47424-2 -.Re -.Sh HISTORY -A -.Nm -device appeared in -.Fx 2.2 . -The current software implementation, -introduced in -.Fx 10.0 , -is by -.An Mark R V Murray , -and is an implementation of the -.Em Fortuna -algorithm by Ferguson -.Em et al . -It replaces the previous -.Em Yarrow -implementation, -introduced in -.Fx 5.0 . -The Yarrow algorithm -is no longer supported -by its authors, -and is therefore no longer available. Modified: head/share/man/man9/random.9 ============================================================================== --- head/share/man/man9/random.9 Mon Apr 15 17:54:40 2019 (r346249) +++ head/share/man/man9/random.9 Mon Apr 15 18:40:36 2019 (r346250) @@ -26,12 +26,13 @@ .\" .\" $FreeBSD$ .\" " -.Dd July 16, 2015 +.Dd April 15, 2019 .Dt RANDOM 9 .Os .Sh NAME .Nm arc4rand , .Nm arc4random , +.Nm arc4random_buf , .Nm random , .Nm read_random , .Nm read_random_uio , @@ -39,86 +40,72 @@ .Nd supply pseudo-random numbers .Sh SYNOPSIS .In sys/libkern.h +.Ft uint32_t +.Fn arc4random "void" .Ft void -.Fn srandom "u_long seed" -.Ft u_long -.Fn random "void" +.Fn arc4random_buf "void *ptr" "size_t len" .Ft void .Fn arc4rand "void *ptr" "u_int length" "int reseed" -.Ft uint32_t -.Fn arc4random "void" .Pp .In sys/random.h -.Ft int +.Ft void .Fn read_random "void *buffer" "int count" .Ft int .Fn read_random_uio "struct uio *uio" "bool nonblock" +.Ss LEGACY ROUTINES +.In sys/libkern.h +.Ft void +.Fn srandom "u_long seed" +.Ft u_long +.Fn random "void" .Sh DESCRIPTION The -.Fn random -function will by default produce -a sequence of numbers -that can be duplicated -by calling -.Fn srandom -with some constant -as the -.Fa seed . -The -.Fn srandom -function may be called with any arbitrary -.Fa seed -value to get slightly more unpredictable numbers. -It is important to remember that the -.Fn random -function is entirely predictable, -and is therefore not of use where -knowledge of the sequence of numbers -may be of benefit to an attacker. +.Fn arc4random +and +.Fn arc4random_buf +functions will return very good quality random numbers, suited for +security-related purposes. +Both are wrappers around the underlying +.Fn arc4rand +interface. +.Fn arc4random +returns a 32-bit random value, while +.Fn arc4random_buf +fills +.Fa ptr +with +.Fa len +bytes of random data. .Pp The .Fn arc4rand -function will return very good quality random numbers, -better suited -for security-related purposes. -The random numbers from -.Fn arc4rand -are seeded from the entropy device -if it is available. -Automatic reseeds happen -after a certain timeinterval -and after a certain number of bytes -have been delivered. -A forced reseed -can be forced -by passing a non-zero -value in the +CSPRNG +is seeded from the +.Xr random 4 +kernel abstract entropy device. +Automatic reseeding happens at unspecified time and bytes (of output) +intervals. +A reseed can be forced by passing a non-zero .Fa reseed -argument. +value. .Pp The .Fn read_random -function is used to return entropy directly from the entropy device -if it has been loaded. -If the entropy device is not loaded, then -the +function is used to read entropy directly from the kernel abstract entropy +device. +.Fn read_random +blocks if and until the entropy device is seeded. +The provided .Fa buffer -is ignored -and zero is returned. -The -.Fa buffer is filled with no more than .Fa count bytes. It is strongly advised that .Fn read_random -is not used; -instead use +is not used directly; +instead, use the .Fn arc4rand -unless it is -necessary to know -that no entropy -has been returned. +family of functions. .Pp The .Fn read_random_uio @@ -129,50 +116,35 @@ on The .Fa uio argument points to a buffer where random data should be stored. -This function only returns data if the random device is seeded. -It blocks if unseeded, -except when the +If .Fa nonblock -argument is true. +is true and the random device is not seeded, this function does not return any +data. +Otherwise, this function may block interruptibly until the random device is seeded. +If the function is interrupted before the random device is seeded, no data is +returned. .Pp -All the bits returned by -.Fn random , -.Fn arc4rand , -.Fn read_random , -and -.Fn read_random_uio -are usable. -For example, -.Sq Li random()&01 -will produce a random binary value. -.Pp -The -.Fn arc4random -is a convenience function which calls -.Fn arc4rand -to return a 32 bit pseudo-random integer. +The legacy +.Fn random +function will produce a sequence of numbers that can be duplicated by calling +.Fn srandom +with some constant as the +.Fa seed . +The legacy +.Fn srandom +function may be called with any +.Fa seed +value. +It is strongly advised that the +.Fn random +function not be used to generate random numbers. +See +.Sx SECURITY CONSIDERATIONS . .Sh RETURN VALUES The -.Fn random -function uses -a non-linear additive feedback random number generator -employing a default table -of size 31 -containing long integers -to return successive pseudo-random -numbers in the range from 0 to -.if t 2\u\s731\s10\d\(mi1. -.if n (2**31)\(mi1. -The period of this random number generator -is very large, -approximately -.if t 16\(mu(2\u\s731\s10\d\(mi1). -.if n 16*((2**31)\(mi1). -.Pp -The .Fn arc4rand -function uses the RC4 algorithm -to generate successive pseudo-random bytes. +function uses the Chacha20 algorithm to generate a pseudo-random sequence of +bytes. The .Fn arc4random function uses @@ -191,6 +163,23 @@ the number of bytes placed in .Fn read_random_uio returns zero when successful, otherwise an error code is returned. +.Pp +The legacy +.Fn random +function uses +a non-linear additive feedback random number generator +employing a default table +of size 31 +containing long integers +to return successive pseudo-random +numbers in the range from 0 to +.if t 2\u\s731\s10\d\(mi1. +.if n (2**31)\(mi1. +The period of this random number generator +is very large, +approximately +.if t 16\(mu(2\u\s731\s10\d\(mi1). +.if n 16*((2**31)\(mi1). .Sh ERRORS .Fn read_random_uio may fail if: @@ -210,3 +199,19 @@ wrote .An Mark R V Murray wrote .Fn read_random . +.Sh SECURITY CONSIDERATIONS +Do not use +.Fn random +or +.Fn srandom +in new code. +.Pp +It is important to remember that the +.Fn random +function is entirely predictable. +It is easy for attackers to predict future output of +.Fn random +by recording some generated values. +We cannot emphasize strongly enough that +.Fn random +must not be used to generate values that are intended to be unpredictable. Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon Apr 15 17:54:40 2019 (r346249) +++ head/sys/dev/random/fortuna.c Mon Apr 15 18:40:36 2019 (r346250) @@ -451,16 +451,22 @@ random_fortuna_read(uint8_t *buf, u_int bytecount) RANDOM_RESEED_UNLOCK(); } +#ifdef _KERNEL +static bool block_seeded_status = false; +SYSCTL_BOOL(_kern_random, OID_AUTO, block_seeded_status, CTLFLAG_RWTUN, + &block_seeded_status, 0, + "If non-zero, pretend Fortuna is in an unseeded state. By setting " + "this as a tunable, boot can be tested as if the random device is " + "unavailable."); +#endif + bool random_fortuna_seeded(void) { #ifdef _KERNEL - /* When set, act as if we are not seeded. */ - KFAIL_POINT_CODE(DEBUG_FP, random_fortuna_seeded, { - if (RETURN_VALUE != 0) - fortuna_state.fs_counter = UINT128_ZERO; - }); + if (block_seeded_status) + return (false); #endif return (!uint128_is_zero(fortuna_state.fs_counter)); Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Mon Apr 15 17:54:40 2019 (r346249) +++ head/sys/dev/random/random_harvestq.c Mon Apr 15 18:40:36 2019 (r346250) @@ -421,11 +421,6 @@ random_harvestq_prime(void *unused __unused) if (keyfile != NULL) { data = preload_fetch_addr(keyfile); size = preload_fetch_size(keyfile); - /* skip the first bit of the stash so others like arc4 can also have some. */ - if (size > RANDOM_CACHED_SKIP_START) { - data += RANDOM_CACHED_SKIP_START; - size -= RANDOM_CACHED_SKIP_START; - } /* Trim the size. If the admin has a file with a funny size, we lose some. Tough. */ size -= (size % sizeof(event.he_entropy)); if (data != NULL && size != 0) { Modified: head/sys/dev/random/random_infra.c ============================================================================== --- head/sys/dev/random/random_infra.c Mon Apr 15 17:54:40 2019 (r346249) +++ head/sys/dev/random/random_infra.c Mon Apr 15 18:40:36 2019 (r346250) @@ -57,12 +57,18 @@ struct random_algorithm *p_random_alg_context = &rando #if defined(RANDOM_LOADABLE) +static void +null_read_random(void *dummy __unused, u_int dummy2 __unused) +{ + panic("%s: no random module is loaded", __func__); +} + struct random_readers { int (*read_random_uio)(struct uio *, bool); - u_int (*read_random)(void *, u_int); + void (*read_random)(void *, u_int); } random_reader_context = { (int (*)(struct uio *, bool))nullop, - (u_int (*)(void *, u_int))nullop, + null_read_random, }; struct sx randomdev_config_lock; @@ -76,7 +82,7 @@ random_infra_sysinit(void *dummy __unused) SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_FIRST, random_infra_sysinit, NULL); void -random_infra_init(int (*p_random_read_uio)(struct uio *, bool), u_int (*p_random_read)(void *, u_int)) +random_infra_init(int (*p_random_read_uio)(struct uio *, bool), void (*p_random_read)(void *, u_int)) { RANDOM_CONFIG_X_LOCK(); @@ -91,7 +97,7 @@ random_infra_uninit(void) RANDOM_CONFIG_X_LOCK(); random_reader_context.read_random_uio = (int (*)(struct uio *, bool))nullop; - random_reader_context.read_random = (u_int (*)(void *, u_int))nullop; + random_reader_context.read_random = null_read_random; RANDOM_CONFIG_X_UNLOCK(); } @@ -114,15 +120,13 @@ read_random_uio(struct uio *uio, bool nonblock) return (retval); } -u_int +void read_random(void *buf, u_int len) { - u_int retval; RANDOM_CONFIG_S_LOCK(); - retval = random_reader_context.read_random(buf, len); + random_reader_context.read_random(buf, len); RANDOM_CONFIG_S_UNLOCK(); - return (retval); } #endif /* defined(RANDOM_LOADABLE) */ Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Mon Apr 15 17:54:40 2019 (r346249) +++ head/sys/dev/random/randomdev.c Mon Apr 15 18:40:36 2019 (r346250) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #define READ_RANDOM_UIO _read_random_uio #define READ_RANDOM _read_random static int READ_RANDOM_UIO(struct uio *, bool); -static u_int READ_RANDOM(void *, u_int); +static void READ_RANDOM(void *, u_int); #else #define READ_RANDOM_UIO read_random_uio #define READ_RANDOM read_random @@ -124,11 +124,53 @@ randomdev_read(struct cdev *dev __unused, struct uio * return (READ_RANDOM_UIO(uio, (flags & O_NONBLOCK) != 0)); } +/* + * If the random device is not seeded, blocks until it is seeded. + * + * Returns zero when the random device is seeded. + * + * If the 'interruptible' parameter is true, and the device is unseeded, this + * routine may be interrupted. If interrupted, it will return either ERESTART + * or EINTR. + */ +#define SEEDWAIT_INTERRUPTIBLE true +#define SEEDWAIT_UNINTERRUPTIBLE false +static int +randomdev_wait_until_seeded(bool interruptible) +{ + int error, spamcount, slpflags; + + slpflags = interruptible ? PCATCH : 0; + + error = 0; + spamcount = 0; + while (!p_random_alg_context->ra_seeded()) { + /* keep tapping away at the pre-read until we seed/unblock. */ + p_random_alg_context->ra_pre_read(); + /* Only bother the console every 10 seconds or so */ + if (spamcount == 0) + printf("random: %s unblock wait\n", __func__); + spamcount = (spamcount + 1) % 100; + error = tsleep(&random_alg_context, slpflags, "randseed", + hz / 10); + if (error == ERESTART || error == EINTR) { + KASSERT(interruptible, + ("unexpected wake of non-interruptible sleep")); + break; + } + /* Squash tsleep timeout condition */ + if (error == EWOULDBLOCK) + error = 0; + KASSERT(error == 0, ("unexpected tsleep error %d", error)); + } + return (error); +} + int READ_RANDOM_UIO(struct uio *uio, bool nonblock) { uint8_t *random_buf; - int error, spamcount; + int error; ssize_t read_len, total_read, c; /* 16 MiB takes about 0.08 s CPU time on my 2017 AMD Zen CPU */ #define SIGCHK_PERIOD (16 * 1024 * 1024) @@ -140,26 +182,13 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); p_random_alg_context->ra_pre_read(); error = 0; - spamcount = 0; /* (Un)Blocking logic */ - while (!p_random_alg_context->ra_seeded()) { - if (nonblock) { + if (!p_random_alg_context->ra_seeded()) { + if (nonblock) error = EWOULDBLOCK; - break; - } - /* keep tapping away at the pre-read until we seed/unblock. */ - p_random_alg_context->ra_pre_read(); - /* Only bother the console every 10 seconds or so */ - if (spamcount == 0) - printf("random: %s unblock wait\n", __func__); - spamcount = (spamcount + 1)%100; - error = tsleep(&random_alg_context, PCATCH, "randseed", hz/10); - if (error == ERESTART || error == EINTR) - break; - /* Squash tsleep timeout condition */ - if (error == EWOULDBLOCK) - error = 0; - KASSERT(error == 0, ("unexpected tsleep error %d", error)); + else + error = randomdev_wait_until_seeded( + SEEDWAIT_INTERRUPTIBLE); } if (error == 0) { read_rate_increment((uio->uio_resid + sizeof(uint32_t))/sizeof(uint32_t)); @@ -210,30 +239,36 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) * It cannot assumed that random_buf is a multiple of * RANDOM_BLOCKSIZE bytes. */ -u_int +void READ_RANDOM(void *random_buf, u_int len) { - u_int read_len; - uint8_t local_buf[len + RANDOM_BLOCKSIZE]; + u_int read_directly_len; KASSERT(random_buf != NULL, ("No suitable random buffer in %s", __func__)); p_random_alg_context->ra_pre_read(); - /* (Un)Blocking logic; if not seeded, return nothing. */ - if (p_random_alg_context->ra_seeded()) { - read_rate_increment((len + sizeof(uint32_t))/sizeof(uint32_t)); - if (len > 0) { - /* - * Belt-and-braces. - * Round up the read length to a crypto block size multiple, - * which is what the underlying generator is expecting. - */ - read_len = roundup(len, RANDOM_BLOCKSIZE); - p_random_alg_context->ra_read(local_buf, read_len); - memcpy(random_buf, local_buf, len); - } - } else - len = 0; - return (len); + /* (Un)Blocking logic */ + if (!p_random_alg_context->ra_seeded()) + (void)randomdev_wait_until_seeded(SEEDWAIT_UNINTERRUPTIBLE); + read_rate_increment(roundup2(len, sizeof(uint32_t))); + if (len == 0) + return; + /* + * The underlying generator expects multiples of + * RANDOM_BLOCKSIZE. + */ + read_directly_len = rounddown(len, RANDOM_BLOCKSIZE); + if (read_directly_len > 0) + p_random_alg_context->ra_read(random_buf, read_directly_len); + if (read_directly_len < len) { + uint8_t remainder_buf[RANDOM_BLOCKSIZE]; + + p_random_alg_context->ra_read(remainder_buf, + sizeof(remainder_buf)); + memcpy((char *)random_buf + read_directly_len, remainder_buf, + len - read_directly_len); + + explicit_bzero(remainder_buf, sizeof(remainder_buf)); + } } static __inline void Modified: head/sys/dev/random/randomdev.h ============================================================================== --- head/sys/dev/random/randomdev.h Mon Apr 15 17:54:40 2019 (r346249) +++ head/sys/dev/random/randomdev.h Mon Apr 15 18:40:36 2019 (r346250) @@ -118,7 +118,7 @@ extern struct sx randomdev_config_lock; #define RANDOM_CONFIG_S_LOCK(x) sx_slock(&randomdev_config_lock) #define RANDOM_CONFIG_S_UNLOCK(x) sx_sunlock(&randomdev_config_lock) #define RANDOM_CONFIG_DEINIT_LOCK(x) sx_destroy(&randomdev_config_lock) -void random_infra_init(int (*)(struct uio *, bool), u_int (*)(void *, u_int)); +void random_infra_init(int (*)(struct uio *, bool), void (*)(void *, u_int)); void random_infra_uninit(void); #endif Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Apr 15 17:54:40 2019 (r346249) +++ head/sys/kern/kern_mib.c Mon Apr 15 18:40:36 2019 (r346250) @@ -159,15 +159,8 @@ sysctl_kern_arnd(SYSCTL_HANDLER_ARGS) char buf[256]; size_t len; - /*- - * This is one of the very few legitimate uses of read_random(9). - * Use of arc4random(9) is not recommended as that will ignore - * an unsafe (i.e. unseeded) random(4). - * - * If random(4) is not seeded, then this returns 0, so the - * sysctl will return a zero-length buffer. - */ - len = read_random(buf, MIN(req->oldlen, sizeof(buf))); + len = MIN(req->oldlen, sizeof(buf)); + read_random(buf, len); return (SYSCTL_OUT(req, buf, len)); } Modified: head/sys/libkern/arc4random.c ============================================================================== --- head/sys/libkern/arc4random.c Mon Apr 15 17:54:40 2019 (r346249) +++ head/sys/libkern/arc4random.c Mon Apr 15 18:40:36 2019 (r346250) @@ -56,7 +56,6 @@ MALLOC_DEFINE(M_CHACHA20RANDOM, "chacha20random", "cha struct chacha20_s { struct mtx mtx; int numbytes; - int first_time_done; time_t t_reseed; u_int8_t m_buffer[CHACHA20_BUFFER_SIZE]; struct chacha_ctx ctx; @@ -73,35 +72,17 @@ static struct chacha20_s *chacha20inst = NULL; * Mix up the current context. */ static void -chacha20_randomstir(struct chacha20_s* chacha20) +chacha20_randomstir(struct chacha20_s *chacha20) { struct timeval tv_now; - size_t n, size; - u_int8_t key[CHACHA20_KEYBYTES], *data; - caddr_t keyfile; + u_int8_t key[CHACHA20_KEYBYTES]; /* - * This is making the best of what may be an insecure - * Situation. If the loader(8) did not have an entropy - * stash from the previous shutdown to load, then we will - * be improperly seeded. The answer is to make sure there - * is an entropy stash at shutdown time. + * If the loader(8) did not have an entropy stash from the previous *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Apr 15 18:49:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21606157B1DE; Mon, 15 Apr 2019 18:49:05 +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 B4C5C8DAC7; Mon, 15 Apr 2019 18:49: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 92430C23B; Mon, 15 Apr 2019 18:49:04 +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 x3FIn45A014503; Mon, 15 Apr 2019 18:49:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FIn4GS014502; Mon, 15 Apr 2019 18:49:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904151849.x3FIn4GS014502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 15 Apr 2019 18:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346251 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 346251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4C5C8DAC7 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.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 15 Apr 2019 18:49:05 -0000 Author: cem Date: Mon Apr 15 18:49:04 2019 New Revision: 346251 URL: https://svnweb.freebsd.org/changeset/base/346251 Log: random.3: Clarify confusing summary random.3 is only "better" in contrast to rand.3. Both are non-cryptographic pseudo-random number generators. The opening blurbs of each's DESCRIPTION section does emphasize this, and correctly directs unfamiliar developers to arc4random(3). However, the summary (".Nd" or Name description) of random.3 conflicted in tone and message with that warning. Resolve the conflict by clarifying in the Nd section that random(3) is non-cryptographic and pseudo-random. Elide the "better" qualifier which implied a comparison but did not provide a specific object to contrast. Sponsored by: Dell EMC Isilon Modified: head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Mon Apr 15 18:40:36 2019 (r346250) +++ head/lib/libc/stdlib/random.3 Mon Apr 15 18:49:04 2019 (r346251) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 26, 2016 +.Dd April 15, 2019 .Dt RANDOM 3 .Os .Sh NAME @@ -37,7 +37,7 @@ .Nm srandomdev , .Nm initstate , .Nm setstate -.Nd better random number generator; routines for changing generators +.Nd non-cryptographic pseudorandom number generator; routines for changing generators .Sh LIBRARY .Lb libc .Sh SYNOPSIS From owner-svn-src-head@freebsd.org Mon Apr 15 18:53:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 043E4157B4D0; Mon, 15 Apr 2019 18:53:30 +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 9ED9E8DFBF; Mon, 15 Apr 2019 18:53:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 613E5C3DE; Mon, 15 Apr 2019 18:53:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3FIrTem019505; Mon, 15 Apr 2019 18:53:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FIrSXI019502; Mon, 15 Apr 2019 18:53:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904151853.x3FIrSXI019502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 15 Apr 2019 18:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346252 - in head/usr.sbin/cron: cron crontab X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin/cron: cron crontab X-SVN-Commit-Revision: 346252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9ED9E8DFBF 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)[-1.000,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, 15 Apr 2019 18:53:30 -0000 Author: kevans Date: Mon Apr 15 18:53:28 2019 New Revision: 346252 URL: https://svnweb.freebsd.org/changeset/base/346252 Log: cron(8): Add MAILFROM ability for crontabs This changes the sender mail address in a similar fashion to how MAILTO may change the recipient. The default from address remains unchanged. MFC after: 1 week Modified: head/usr.sbin/cron/cron/cron.8 head/usr.sbin/cron/cron/do_command.c head/usr.sbin/cron/crontab/crontab.5 Modified: head/usr.sbin/cron/cron/cron.8 ============================================================================== --- head/usr.sbin/cron/cron/cron.8 Mon Apr 15 18:49:04 2019 (r346251) +++ head/usr.sbin/cron/cron/cron.8 Mon Apr 15 18:53:28 2019 (r346252) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2017 +.Dd April 15, 2019 .Dt CRON 8 .Os .Sh NAME @@ -79,6 +79,9 @@ commands, any output is mailed to the owner of the cro named in the .Ev MAILTO environment variable in the crontab, if such exists). +The from address of this mail may be set with the +.Ev MAILFROM +environment variable. .Pp Additionally, .Nm Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Mon Apr 15 18:49:04 2019 (r346251) +++ head/usr.sbin/cron/cron/do_command.c Mon Apr 15 18:53:28 2019 (r346252) @@ -93,7 +93,7 @@ child_process(e, u) { int stdin_pipe[2], stdout_pipe[2]; register char *input_data; - char *usernm, *mailto; + char *usernm, *mailto, *mailfrom; int children = 0; # if defined(LOGIN_CAP) struct passwd *pwd; @@ -111,6 +111,7 @@ child_process(e, u) */ usernm = env_get("LOGNAME", e->envp); mailto = env_get("MAILTO", e->envp); + mailfrom = env_get("MAILFROM", e->envp); #ifdef PAM /* use PAM to see if the user's account is available, @@ -503,8 +504,12 @@ child_process(e, u) warn("%s", MAILCMD); (void) _exit(ERROR_EXIT); } - fprintf(mail, "From: Cron Daemon <%s@%s>\n", - usernm, hostname); + if (mailfrom == NULL || *mailfrom == '\0') + fprintf(mail, "From: Cron Daemon <%s@%s>\n", + usernm, hostname); + else + fprintf(mail, "From: Cron Daemon <%s>\n", + mailfrom); fprintf(mail, "To: %s\n", mailto); fprintf(mail, "Subject: Cron <%s@%s> %s\n", usernm, first_word(hostname, "."), Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Mon Apr 15 18:49:04 2019 (r346251) +++ head/usr.sbin/cron/crontab/crontab.5 Mon Apr 15 18:53:28 2019 (r346252) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2018 +.Dd April 15, 2019 .Dt CRONTAB 5 .Os .Sh NAME @@ -116,6 +116,9 @@ If .Ev MAILTO is defined (and non-empty), mail is sent to the user so named. +If +.Ev MAILFROM +is defined (and non-empty), its value will be used as the from address. .Ev MAILTO may also be used to direct mail to multiple recipients by separating recipient users with a comma. From owner-svn-src-head@freebsd.org Mon Apr 15 18:54:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93E3157B569 for ; Mon, 15 Apr 2019 18:54:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0F28E113 for ; Mon, 15 Apr 2019 18:54:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DE83DBB6E for ; Mon, 15 Apr 2019 18:54:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f48.google.com with SMTP id u17so13942156lfi.3 for ; Mon, 15 Apr 2019 11:54:57 -0700 (PDT) X-Gm-Message-State: APjAAAVXvy0yc3t/d1c9iwetz7lKhtF2gxVU6NCG1jTt1Qfyjb8r18cW xqWv6Ec7/PIrzXjr76t/L6eJInTX1dnqur5h5Qk= X-Received: by 2002:ac2:53a4:: with SMTP id j4mt30451171lfh.106.1555354496614; Mon, 15 Apr 2019 11:54:56 -0700 (PDT) MIME-Version: 1.0 References: <201904151853.x3FIrSXI019502@repo.freebsd.org> In-Reply-To: <201904151853.x3FIrSXI019502@repo.freebsd.org> From: Kyle Evans Date: Mon, 15 Apr 2019 13:54:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346252 - in head/usr.sbin/cron: cron crontab Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4A0F28E113 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.982,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, 15 Apr 2019 18:54:58 -0000 On Mon, Apr 15, 2019 at 1:53 PM Kyle Evans wrote: > > Author: kevans > Date: Mon Apr 15 18:53:28 2019 > New Revision: 346252 > URL: https://svnweb.freebsd.org/changeset/base/346252 > > Log: > cron(8): Add MAILFROM ability for crontabs > > This changes the sender mail address in a similar fashion to how MAILTO may > change the recipient. The default from address remains unchanged. > > MFC after: 1 week > I failed to ^C this in time to add: PR: 140304 From owner-svn-src-head@freebsd.org Mon Apr 15 19:21:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 384E9157C2C4; Mon, 15 Apr 2019 19:21:46 +0000 (UTC) (envelope-from pkubaj@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 008B28F485; Mon, 15 Apr 2019 19:21:46 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D20D1C8B4; Mon, 15 Apr 2019 19:21:45 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3FJLjNg034641; Mon, 15 Apr 2019 19:21:45 GMT (envelope-from pkubaj@FreeBSD.org) Received: (from pkubaj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FJLjcP034640; Mon, 15 Apr 2019 19:21:45 GMT (envelope-from pkubaj@FreeBSD.org) Message-Id: <201904151921.x3FJLjcP034640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkubaj set sender to pkubaj@FreeBSD.org using -f From: Piotr Kubaj Date: Mon, 15 Apr 2019 19:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346253 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: pkubaj X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 346253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 008B28F485 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.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 15 Apr 2019 19:21:46 -0000 Author: pkubaj (ports committer) Date: Mon Apr 15 19:21:45 2019 New Revision: 346253 URL: https://svnweb.freebsd.org/changeset/base/346253 Log: Add myself to committer list. Approved by: tcberner (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Apr 15 18:53:28 2019 (r346252) +++ head/share/misc/committers-ports.dot Mon Apr 15 19:21:45 2019 (r346253) @@ -217,6 +217,7 @@ pgollucci [label="Philip M. Gollucci\npgollucci@FreeBS philip [label="Philip Paeps\nphilip@FreeBSD.org\n2005/10/19"] pi [label="Kurt Jaeger\npi@FreeBSD.org\n2014/03/14"] pizzamig [label="Luca Pizzamiglio\npizzamig@FreeBSD.org\n2017/08/25"] +pkubaj [label="Piotr Kubaj\npkubaj@FreeBSD.org\n2019/04/14"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"] rakuco [label="Raphael Kubo da Costa\nrakuco@FreeBSD.org\n2011/08/22"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] @@ -519,6 +520,7 @@ ler -> leres lifanov -> ultima linimon -> hrs +linimon -> pkubaj lioux -> pat @@ -555,6 +557,7 @@ mat -> thierry mat -> tobik mat -> woodsb02 mat -> rigoletto +mat -> pkubaj matthew -> leres matthew -> lifanov @@ -719,6 +722,7 @@ tcberner -> fernape tcberner -> arrowd tcberner -> rigoletto tcberner -> kai +tcberner -> pkubaj thierry -> jadawin thierry -> riggs From owner-svn-src-head@freebsd.org Mon Apr 15 19:26:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEC18157C422 for ; Mon, 15 Apr 2019 19:26:33 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 310558F74E for ; Mon, 15 Apr 2019 19:26:32 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555356384; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=ffVCC/kRYYRGYvfoq4aun9Jx31Mk0a0wbDo767UsWXYpZsr+kfG+tRf4E1fM7dFCUgGcPXDJJjyvK WjD8Q/s/SQ6fUwhJpN+ftIn+La35WoVPW2Gfl7UbYK+eQPLaA1GgYF+Gl+j/Rbf7fD+Y1djUkeQirE 5czSC4mASqxTBkAx+/LrVwXY8Jbxb16jLJ+E8k9nuYssYBBVkm6N/J4yaqpwNI+mY/SkzakLRoLblm +qr0IcbXTZkfcNJWF8RBF/LJ1lzOyepoq52MgfzIp0R5R7WrsHrNpJRgM22SM/UuF2hyKoGwa5TgOj oQ3T3IV+PNK/zCCrpRXthtAlboGHV2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=6BGyUiTjdkbuNqFq/TaItP4XPq3mKjVsS68RHxYHZOU=; b=qMznv9r9SVW0IU5OmFafdOHSxznWd2P1pVh7tN3C8yN2pRGHTsJNFEzvnjqtoHG1XPzWDLKoh3HeA rYyAib82NxNd5IwCGTe8Fd8IxfTEVuY6Bu7H4kBv/ATmg4x7VYiFKU9t7ZpscfvPV+qNDWd2TauVMK aTqH3OYeKRyCPCS+J7OW6YUJ3L6zX9uBs39sm9+/7wLZj9w900CEyIz2Ck/QKuAURDUETVMAuu0uKJ iHhRCRmPtbP1ctUJvO74jOObr+9O5dPypC01l4VOF26Z3TL7OlhespvgmKsa8iZ4Xur6jv+DhVeoAc bZqX/LK95QB9jLdvaYnTSYm96MTsZBw== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=6BGyUiTjdkbuNqFq/TaItP4XPq3mKjVsS68RHxYHZOU=; b=d5+N68dzUowS8eDoNY1j8AptOJfdmCUGfoyf8x/PdYaQyFuoGzq+kbofN77W+tHdrrSxFITpNulko OYGJNy58TB4z2D/9HHer4vQzyRkgGc5NPNlnIgV2hmdSUceaqpvlorJUvJHrIcY7GmZq2vP5UdjtbZ vwURjVF+fQwrDyKTzJoDSZLz1v5Wi8uIxS9q1tyrOLQ5WGghiWtceqkD1OYVb1hSe5rhtzk16pvEtz XjmA32BKw3i0wd0Bew+/o2skc5jSwvVLBZF/IcOT1u7To5Rq5FQ/GpIBX/UZPIBOt7O/WPoiEBdE2T O5NzOg2H1EKJm0mbnQjG9cXa/DsQBzQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 5946b379-5fb4-11e9-908b-352056dbf2de X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id 5946b379-5fb4-11e9-908b-352056dbf2de; Mon, 15 Apr 2019 19:26:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3FJQK1h040045; Mon, 15 Apr 2019 13:26:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r346252 - in head/usr.sbin/cron: cron crontab From: Ian Lepore To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 15 Apr 2019 13:26:20 -0600 In-Reply-To: <201904151853.x3FIrSXI019502@repo.freebsd.org> References: <201904151853.x3FIrSXI019502@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 310558F74E 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.987,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: Mon, 15 Apr 2019 19:26:34 -0000 On Mon, 2019-04-15 at 18:53 +0000, Kyle Evans wrote: > Author: kevans > Date: Mon Apr 15 18:53:28 2019 > New Revision: 346252 > URL: https://svnweb.freebsd.org/changeset/base/346252 > > Log: > cron(8): Add MAILFROM ability for crontabs > > This changes the sender mail address in a similar fashion to how MAILTO may > change the recipient. The default from address remains unchanged. > > MFC after: 1 week > > Modified: > head/usr.sbin/cron/cron/cron.8 > head/usr.sbin/cron/cron/do_command.c > head/usr.sbin/cron/crontab/crontab.5 > Is this going to allow normal users to spoof the From: using private crontabs? That sounds mildly dangerous. -- Ian > Modified: head/usr.sbin/cron/cron/cron.8 > ===================================================================== > ========= > --- head/usr.sbin/cron/cron/cron.8 Mon Apr 15 18:49:04 2019 (r346 > 251) > +++ head/usr.sbin/cron/cron/cron.8 Mon Apr 15 18:53:28 2019 (r346 > 252) > @@ -17,7 +17,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 19, 2017 > +.Dd April 15, 2019 > .Dt CRON 8 > .Os > .Sh NAME > @@ -79,6 +79,9 @@ commands, any output is mailed to the owner of the > cro > named in the > .Ev MAILTO > environment variable in the crontab, if such exists). > +The from address of this mail may be set with the > +.Ev MAILFROM > +environment variable. > .Pp > Additionally, > .Nm > > Modified: head/usr.sbin/cron/cron/do_command.c > ===================================================================== > ========= > --- head/usr.sbin/cron/cron/do_command.c Mon Apr 15 18:49:04 > 2019 (r346251) > +++ head/usr.sbin/cron/cron/do_command.c Mon Apr 15 18:53:28 > 2019 (r346252) > @@ -93,7 +93,7 @@ child_process(e, u) > { > int stdin_pipe[2], stdout_pipe[2]; > register char *input_data; > - char *usernm, *mailto; > + char *usernm, *mailto, *mailfrom; > int children = 0; > # if defined(LOGIN_CAP) > struct passwd *pwd; > @@ -111,6 +111,7 @@ child_process(e, u) > */ > usernm = env_get("LOGNAME", e->envp); > mailto = env_get("MAILTO", e->envp); > + mailfrom = env_get("MAILFROM", e->envp); > > #ifdef PAM > /* use PAM to see if the user's account is available, > @@ -503,8 +504,12 @@ child_process(e, u) > warn("%s", MAILCMD); > (void) _exit(ERROR_EXIT); > } > - fprintf(mail, "From: Cron Daemon > <%s@%s>\n", > - usernm, hostname); > + if (mailfrom == NULL || *mailfrom == > '\0') > + fprintf(mail, "From: Cron > Daemon <%s@%s>\n", > + usernm, hostname); > + else > + fprintf(mail, "From: Cron > Daemon <%s>\n", > + mailfrom); > fprintf(mail, "To: %s\n", mailto); > fprintf(mail, "Subject: Cron <%s@%s> > %s\n", > usernm, first_word(hostname, > "."), > > Modified: head/usr.sbin/cron/crontab/crontab.5 > ===================================================================== > ========= > --- head/usr.sbin/cron/crontab/crontab.5 Mon Apr 15 18:49:04 > 2019 (r346251) > +++ head/usr.sbin/cron/crontab/crontab.5 Mon Apr 15 18:53:28 > 2019 (r346252) > @@ -17,7 +17,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd June 6, 2018 > +.Dd April 15, 2019 > .Dt CRONTAB 5 > .Os > .Sh NAME > @@ -116,6 +116,9 @@ If > .Ev MAILTO > is defined (and non-empty), mail is > sent to the user so named. > +If > +.Ev MAILFROM > +is defined (and non-empty), its value will be used as the from > address. > .Ev MAILTO > may also be used to direct mail to multiple recipients > by separating recipient users with a comma. > From owner-svn-src-head@freebsd.org Mon Apr 15 19:44:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6811B157CA06; Mon, 15 Apr 2019 19:44:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09D01900F6; Mon, 15 Apr 2019 19:44:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 95139C100; Mon, 15 Apr 2019 19:44:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f171.google.com with SMTP id k8so16829046lja.8; Mon, 15 Apr 2019 12:44:23 -0700 (PDT) X-Gm-Message-State: APjAAAWogPwY1fp+ECX7c86vKphf2JoBEqXhWOswgcXyewDSiFxgbrtG hfFNr+rpx4wyZekk6EPAIFSNywupdt4ZA3XUXCg= X-Google-Smtp-Source: APXvYqwOXYpd3W0JDA95iUsk4jrqGHzPyTuBKd1CJX6Id0L1EAaGsMbPSIO5TT7srz7hse3g/XxsvhqPuaod2OxhxKM= X-Received: by 2002:a2e:6a14:: with SMTP id f20mr43030003ljc.65.1555357462247; Mon, 15 Apr 2019 12:44:22 -0700 (PDT) MIME-Version: 1.0 References: <201904151853.x3FIrSXI019502@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Mon, 15 Apr 2019 14:44:03 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346252 - in head/usr.sbin/cron: cron crontab To: Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 09D01900F6 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.975,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: Mon, 15 Apr 2019 19:44:24 -0000 On Mon, Apr 15, 2019 at 2:26 PM Ian Lepore wrote: > > On Mon, 2019-04-15 at 18:53 +0000, Kyle Evans wrote: > > Author: kevans > > Date: Mon Apr 15 18:53:28 2019 > > New Revision: 346252 > > URL: https://svnweb.freebsd.org/changeset/base/346252 > > > > Log: > > cron(8): Add MAILFROM ability for crontabs > > > > This changes the sender mail address in a similar fashion to how MAILTO may > > change the recipient. The default from address remains unchanged. > > > > MFC after: 1 week > > > > Modified: > > head/usr.sbin/cron/cron/cron.8 > > head/usr.sbin/cron/cron/do_command.c > > head/usr.sbin/cron/crontab/crontab.5 > > > > Is this going to allow normal users to spoof the From: using private > crontabs? That sounds mildly dangerous. > > -- Ian I think my description here was lacking- this is a per-crontab environment variable, so yes: a user may spoof the from address in a private crontab for jobs within that crontab. I don't know how much of a security concern this is, but I peaked at cronie [1] after you brought this up and observed that their implementation is effectively the same restriction-wise, but with sanity checking for both mailfrom/mailto values. [1] https://github.com/cronie-crond/cronie/blob/master/src/do_command.c From owner-svn-src-head@freebsd.org Mon Apr 15 21:20:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19DF5157E5D5; Mon, 15 Apr 2019 21:20:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B0A3593401; Mon, 15 Apr 2019 21:20:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F8B1DB98; Mon, 15 Apr 2019 21:20:06 +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 x3FLK6Aa095196; Mon, 15 Apr 2019 21:20:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FLK6N8095195; Mon, 15 Apr 2019 21:20:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904152120.x3FLK6N8095195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 15 Apr 2019 21:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346254 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 346254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0A3593401 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)[-1.000,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: Mon, 15 Apr 2019 21:20:07 -0000 Author: kevans Date: Mon Apr 15 21:20:06 2019 New Revision: 346254 URL: https://svnweb.freebsd.org/changeset/base/346254 Log: config(8): replace opteq with a call to strcasecmp This obscures the comparison slightly less; when option name appear in files, they are case-insensitive. MFC after: 1 week Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Mon Apr 15 19:21:45 2019 (r346253) +++ head/usr.sbin/config/mkmakefile.c Mon Apr 15 21:20:06 2019 (r346254) @@ -62,7 +62,6 @@ static void do_rules(FILE *); static void do_xxfiles(char *, FILE *); static void do_objs(FILE *); static void do_before_depend(FILE *); -static int opteq(const char *, const char *); static void read_files(void); static void sanitize_envline(char *result, const char *src); static bool preprocess(char *line, char *result); @@ -565,7 +564,8 @@ next: goto nextparam; } SLIST_FOREACH(op, &opt, op_next) - if (op->op_value == 0 && opteq(op->op_name, wd)) { + if (op->op_value == 0 && + strcasecmp(op->op_name, wd) == 0) { if (not) match = 0; goto nextparam; @@ -625,23 +625,6 @@ read_files(void) tnl = STAILQ_NEXT(nl, f_next); free(nl->f_name); free(nl); - } -} - -static int -opteq(const char *cp, const char *dp) -{ - char c, d; - - for (; ; cp++, dp++) { - if (*cp != *dp) { - c = isupper(*cp) ? tolower(*cp) : *cp; - d = isupper(*dp) ? tolower(*dp) : *dp; - if (c != d) - return (0); - } - if (*cp == 0) - return (1); } } From owner-svn-src-head@freebsd.org Mon Apr 15 23:34:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A92158067A; Mon, 15 Apr 2019 23:34:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6936796FF6; Mon, 15 Apr 2019 23:34:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f42.google.com with SMTP id f6so16124998iop.3; Mon, 15 Apr 2019 16:34:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6534R8IMbkKBj/k90kOsweS8NqFWXQkz7n3CggVJo3o=; b=qP4xjSmJj/lGBxnujdJfXoqoSJ5dq65dqk3P5jetLXBuEkAXWIQj7JUPUq7XlmGilG 7VNK/B1+GJqUulmvdBmgaO+dJ3BDai3HxlkImHjkQxaZ+QdAOViPh9xI5dJOdTK+gkEO Zzxh5JdCM+HLMX2J78tOro6DUSHv3B0l+vWU/78LOcKU6qgwK0YodmMUMVceJOYHp973 55lHRDjaNgiWh3curJ51T1+xTmKZfuxWnyFjYEqOo1TXhDaS+GfCczT1P91UcAp/IyQs ZRgIIiLGFVK2ZF214daVMBwGB3SNMYXa+CappUdr1KuzYY9OiSP+NuitMBz/p1cJaiG4 nRag== X-Gm-Message-State: APjAAAWxV5gxFwP7x1YanbEyFnMieEVsTTOQ0LnCmjlpwjVDVyuibuDU zYsrlAFSV3sgClySe11HsIL/OUX2Bu3JWfRtDnZkVgwf X-Google-Smtp-Source: APXvYqzUTFV3A/SdG3+x9QGqZFqCYfjjxF10dESzd4cYNSmiP6z+iYNDna9lIO+19ue7thQQ4fO8xY5xHpOVWgUk1AM= X-Received: by 2002:a5e:9e0d:: with SMTP id i13mr54108057ioq.156.1555367738051; Mon, 15 Apr 2019 15:35:38 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> In-Reply-To: <201904151840.x3FIeaEQ009242@repo.freebsd.org> From: Ed Maste Date: Mon, 15 Apr 2019 18:35:26 -0400 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 6936796FF6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.922,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: Mon, 15 Apr 2019 23:34:38 -0000 On Mon, 15 Apr 2019 at 14:40, Conrad Meyer wrote: > > Author: cem > Date: Mon Apr 15 18:40:36 2019 > New Revision: 346250 > URL: https://svnweb.freebsd.org/changeset/base/346250 > > Log: > random(4): Block read_random(9) on initial seeding Because Gerald (one of the FreeBSD Foundation's co-op students for this term) is not on the svn mailing list I'll bring his report from GitHub[1] over here: As probably also seen from the official CI (https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/), this commit prevents booting on both arm and arm64. Condensed Error log (arm64 Pine A64-LTS) random: randomdev_wait_until_seeded unblock wait panic: _sleep: curthread not running cpuid = 0 time = 1 KDB: stack backtrace: <...> randomdev_wait_until_seeded() at read_random+0x50 pc = 0xffff00000021b850 lr = 0xffff00000021b930 sp = 0xffff000000010a00 fp = 0xffff000000010a40 read_random() at arc4rand+0x168 pc = 0xffff00000021b930 lr = 0xffff00000049ae5c sp = 0xffff000000010a50 fp = 0xffff000000010af0 arc4rand() at __stack_chk_init+0x18 pc = 0xffff00000049ae5c lr = 0xffff0000003f0558 sp = 0xffff000000010b00 fp = 0xffff000000010b40 <....> [1] https://github.com/freebsd/freebsd/commit/654aeb58dd40d3db3af91ce26c9c31d1b02cee5f#commitcomment-33187782 From owner-svn-src-head@freebsd.org Tue Apr 16 00:01:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 533851580D97; Tue, 16 Apr 2019 00:01:16 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4D30978F1; Tue, 16 Apr 2019 00:01:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-x235.google.com with SMTP id k8so17347881lja.8; Mon, 15 Apr 2019 17:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lFkm5IXG0ETABlNsyxhSNYu8cRbT+FBp5mDzpwFupwY=; b=Yp+n58ETYKd+l/MzqcIzfnzr6tNG7tDgKbz7gCPiVshTzY3gaUWDNkYTfm9hr6zydJ nWqhO/mQqY3N8VwBUFiBIAxvnlmHFMDryIXaxraEumBF0Ha1Bqlan4CGNW7otE9Wl2Bh 5vo2LS2WtGVRDt04KLMzECXmado4zE9zpAMXlD2wLwsglCoRdPR3Pv3UZISttdZBblmD /FIk4PxqReFLg6ATVVQt+eeZIvlQQ+9vhSpkGydjEj/icaQeXakvtJ1YwTSufyTMUn7p 16RV7S72FonAni6+qwvV9SVW+UAh2Vzi3ZKKmnQFC9fb4SGJTUR/aRzDWgGlIQtbVfwE fZZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lFkm5IXG0ETABlNsyxhSNYu8cRbT+FBp5mDzpwFupwY=; b=uFsPRRTIVzR8HlPHTxKEHtFw3ad/vh/croqbp9NGb/uBvzYacVmoSHhGoMOUWo6Bhk TZecsSPMcjpUGOXM2Z4K+9MJkyV2JhVOCe5O14g0m7OIUx6Vo9/Q0UWNuL5W+//TC6qt 1+pA06Hii7yjSPqsG5CcgwEAVragAMA5N2Dc5clFjMx8RhBivJH8oIfTg8nOxTCXIbAV ANlPvKslxm/pIdr3GKP12fpnoanu1LkhagEKvXxuS46mJO/oYqAgFeZLERSyqMw/GxFI KjzddXCZvdCFGaMDJn3OsUK3Csb+pgGcDsc07uQEkVs6NBZ4xOAK7wZZUVUZu2XFTuEV pp9Q== X-Gm-Message-State: APjAAAXiVJF0LMIAZa1+1nbdVlMRNNDfA7il5nmFukF2ny4IEnNQ0e49 BPfegGkcnIyQUIUHtJjJdkyGlsUlpywBHYRnlKTWSQ== X-Google-Smtp-Source: APXvYqzOcwTzqIEtR9q+Psd8BT3V0bjdD11CGF+M9UurBnIMsSRt3c9+vj0mhTTv1Y0cYZzyNvjtcX2lAKQTtTWOQpM= X-Received: by 2002:a2e:808e:: with SMTP id i14mr43588957ljg.103.1555372873489; Mon, 15 Apr 2019 17:01:13 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> In-Reply-To: From: Justin Hibbits Date: Mon, 15 Apr 2019 19:01:05 -0500 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Ed Maste Cc: Conrad Meyer , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: B4D30978F1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.921,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Tue, 16 Apr 2019 00:01:16 -0000 On Mon, Apr 15, 2019, 18:34 Ed Maste wrote: > On Mon, 15 Apr 2019 at 14:40, Conrad Meyer wrote: > > > > Author: cem > > Date: Mon Apr 15 18:40:36 2019 > > New Revision: 346250 > > URL: https://svnweb.freebsd.org/changeset/base/346250 > > > > Log: > > random(4): Block read_random(9) on initial seeding > > Because Gerald (one of the FreeBSD Foundation's co-op students for > this term) is not on the svn mailing list I'll bring his report from > GitHub[1] over here: > > As probably also seen from the official CI > (https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/), this commit > prevents booting on both arm and arm64. > > Condensed Error log (arm64 Pine A64-LTS) > > random: randomdev_wait_until_seeded unblock wait > panic: _sleep: curthread not running > cpuid = 0 > time = 1 > KDB: stack backtrace: > <...> > randomdev_wait_until_seeded() at read_random+0x50 > pc = 0xffff00000021b850 lr = 0xffff00000021b930 > sp = 0xffff000000010a00 fp = 0xffff000000010a40 > > read_random() at arc4rand+0x168 > pc = 0xffff00000021b930 lr = 0xffff00000049ae5c > sp = 0xffff000000010a50 fp = 0xffff000000010af0 > > arc4rand() at __stack_chk_init+0x18 > pc = 0xffff00000049ae5c lr = 0xffff0000003f0558 > sp = 0xffff000000010b00 fp = 0xffff000000010b40 > > <....> > > [1] > https://github.com/freebsd/freebsd/commit/654aeb58dd40d3db3af91ce26c9c31d1b02cee5f#commitcomment-33187782 Given the discussion over there it would probably also fail on powernv, which also does not use loader. - Justin > > From owner-svn-src-head@freebsd.org Tue Apr 16 00:41:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8614415819DE; Tue, 16 Apr 2019 00:41:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 2F50369EE9; Tue, 16 Apr 2019 00:41:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A8CF18025; Tue, 16 Apr 2019 00:41:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3G0fMFN002419; Tue, 16 Apr 2019 00:41:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G0fMdq002418; Tue, 16 Apr 2019 00:41:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201904160041.x3G0fMdq002418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Apr 2019 00:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346255 - head/usr.bin/jot X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/usr.bin/jot X-SVN-Commit-Revision: 346255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F50369EE9 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 00:41:23 -0000 Author: bdrewery Date: Tue Apr 16 00:41:22 2019 New Revision: 346255 URL: https://svnweb.freebsd.org/changeset/base/346255 Log: Fix 'jot -r 0 start end' to work. This allows an endless stream of random data within the given bounds. It already worked if a seed was provided as the 4th argument but not if one was left out. In collaboration with: jhb MFC after: 2 weeks Relnotes: yes Modified: head/usr.bin/jot/jot.c Modified: head/usr.bin/jot/jot.c ============================================================================== --- head/usr.bin/jot/jot.c Mon Apr 15 21:20:06 2019 (r346254) +++ head/usr.bin/jot/jot.c Tue Apr 16 00:41:22 2019 (r346255) @@ -263,12 +263,15 @@ main(int argc, char **argv) mask = 0; break; case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER: - if (reps == 0) - errx(1, "infinite sequences cannot be bounded"); - else if (reps == 1) - s = 0.0; - else - s = (ender - begin) / (reps - 1); + if (!randomize) { + if (reps == 0) + errx(1, "infinite sequences cannot " + "be bounded"); + else if (reps == 1) + s = 0.0; + else + s = (ender - begin) / (reps - 1); + } mask = 0; break; case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER | HAVE_STEP: From owner-svn-src-head@freebsd.org Tue Apr 16 00:53:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2730A1581FE8; Tue, 16 Apr 2019 00:53:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B637D6AD17; Tue, 16 Apr 2019 00:53:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id f22so29917028ita.3; Mon, 15 Apr 2019 17:53:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=sEBtxyScHp8FekuWo2GXX+oION1nLrUincxhp2eL/XA=; b=uLRyR9hXEjYQ0UQeXD+mRFO1moiIbmVsMwXTciE5R2gznTCrNH5pyAqKJc7QbgcZI/ bXwwfhkBqKWlp6Z6BcXs6pk1RzCcjU/td6yBKTtY8qfRqrnCCl+8UbXdSqvrnEMHIzvM i/Dwe1RbwcRmqbLO8U64gqJT5P5v/KmGokMzp7UDu/BPYrMJz9eUpAXOaV4aMSh1qbn4 fZxziMo2BA+6EsupMXDIbK7ALLzrf9wUtHnPsQvSEKAhcYxs7r9iQuWV/IfjCEkzzf7k 2Dn+VtK+dBjpZ51e3F/U3ugB1uZSkmNaLBtnsJLix+kkr3DurYPYcl8zd2Qu6kR4/Mun XYng== X-Gm-Message-State: APjAAAVHVwYBV6Z2rBKgu4ajVLl9IU1I0vALWsxCRY7pZa63wOT1dx2H YeYjgqixOcKq6nQH0n+XE2+VxqlG X-Google-Smtp-Source: APXvYqxac1DvS/I+gZFs4Wf9zd5pNJYVMfqglkmiSJMNbW9NWoJSPYskQkWaVq0qgs9vYgRx5CSNVw== X-Received: by 2002:a02:1a45:: with SMTP id 66mr53336755jai.124.1555376008970; Mon, 15 Apr 2019 17:53:28 -0700 (PDT) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com. [209.85.166.49]) by smtp.gmail.com with ESMTPSA id x187sm9014852itb.39.2019.04.15.17.53.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 17:53:28 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id v4so16248352ioj.5; Mon, 15 Apr 2019 17:53:28 -0700 (PDT) X-Received: by 2002:a6b:7b08:: with SMTP id l8mr1037567iop.33.1555376008600; Mon, 15 Apr 2019 17:53:28 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 15 Apr 2019 17:53:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Justin Hibbits Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: B637D6AD17 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.966,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 00:53:36 -0000 Hi Justin, On Mon, Apr 15, 2019 at 5:01 PM Justin Hibbits wrote: > Given the discussion over there it would probably also fail on powernv, which also does not use loader. Does power use bsdinstall (which populates /boot/entropy at install time via usr.sbin/bsdinstall/scripts/entropy) and install the libexec/rc/rc.d/random rc script (which re-emits new /boot/entropy on every startup)? If so, it should be ok. The problem is new installs that don't use bsdinstall or otherwise provide initial /boot/entropy. E.g., the CI infrastructure for Riscv/Arm is/was generating minimal filesystem images and not populating /boot/entropy. Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 00:55:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4757158209A; Tue, 16 Apr 2019 00:55:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3397D6AE76; Tue, 16 Apr 2019 00:55:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id w15so29919028itc.0; Mon, 15 Apr 2019 17:55:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=RINATsYN6udViLNcMKYz7FUgSg61bd9c6wDE0o5HnG4=; b=Wtq2Sa590GmpVQogIa5YcBT5wj8L189wX2eLDjeYELRyIpP8WrtaCgbHSfdm8v1yBS HDU+08SqIfpSHkHY1G/I6WMr32fxls8maceZWLFezVac4iy99r5tOEHOvnkaWL7c5EVd wr3cVlcQ9YL1ikHVh244dhrFkxcOOHHAcZvEnDJm7AGG0SqHQ2B7OAkaWieastmj1uH9 7kme9ueg5L5KwCnHs/XDQCxwaOvdds0fFnsKHUGaiiGI5epayRL4RovILla28aF310hZ zsRc7eRufxzJYorHOor8kjCTQa4nqB6hBI3vgy5yXnhqspXNdqGHptRAOBwLC1W0cRTQ OeVQ== X-Gm-Message-State: APjAAAVyi+qAzliHBl0/MRg3pohnNxyx81c5X3/BLZLKnkaHiVP554rS LZC2QZGLmqnDpRO2rv1RMbxUIjpu X-Google-Smtp-Source: APXvYqwYJTc9YDRRhZy0CcaVYzgvwu1V+02crWNyN8fLEK3lfIUjwrPiccHJTn068tWXfDXmyDeFTA== X-Received: by 2002:a24:5ec2:: with SMTP id h185mr27777256itb.19.1555376106930; Mon, 15 Apr 2019 17:55:06 -0700 (PDT) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com. [209.85.166.182]) by smtp.gmail.com with ESMTPSA id w184sm8807530ita.9.2019.04.15.17.55.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 17:55:06 -0700 (PDT) Received: by mail-it1-f182.google.com with SMTP id a190so13574171ite.4; Mon, 15 Apr 2019 17:55:06 -0700 (PDT) X-Received: by 2002:a24:4584:: with SMTP id c4mr28414249itd.163.1555376106636; Mon, 15 Apr 2019 17:55:06 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 15 Apr 2019 17:54:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Justin Hibbits Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 3397D6AE76 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 00:55:08 -0000 On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer wrote: > E.g., the CI infrastructure for > Riscv/Arm is/was generating minimal filesystem images and not > populating /boot/entropy. I should add, I say "is/was" because I have a PR out which may address the problem: https://github.com/freebsd/freebsd-ci/pull/31 Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 02:28:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C43BF158498F; Tue, 16 Apr 2019 02:28:36 +0000 (UTC) (envelope-from mw@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 6C6696E033; Tue, 16 Apr 2019 02:28:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 484D41918D; Tue, 16 Apr 2019 02:28:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3G2Satd057158; Tue, 16 Apr 2019 02:28:36 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G2SZIg057157; Tue, 16 Apr 2019 02:28:35 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201904160228.x3G2SZIg057157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 16 Apr 2019 02:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346259 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 346259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C6696E033 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,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, 16 Apr 2019 02:28:37 -0000 Author: mw Date: Tue Apr 16 02:28:35 2019 New Revision: 346259 URL: https://svnweb.freebsd.org/changeset/base/346259 Log: tpm: Prevent session hijack Check caller thread id before allowing to read the buffer to make sure that it can only be accessed by the thread that did the associated write to the TPM. Submitted by: Kornel Duleba Reviewed by: delphij Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D19713 Modified: head/sys/dev/tpm/tpm20.c head/sys/dev/tpm/tpm20.h Modified: head/sys/dev/tpm/tpm20.c ============================================================================== --- head/sys/dev/tpm/tpm20.c Tue Apr 16 02:12:38 2019 (r346258) +++ head/sys/dev/tpm/tpm20.c Tue Apr 16 02:28:35 2019 (r346259) @@ -77,6 +77,10 @@ tpm20_read(struct cdev *dev, struct uio *uio, int flag callout_stop(&sc->discard_buffer_callout); sx_xlock(&sc->dev_lock); + if (sc->owner_tid != uio->uio_td->td_tid) { + sx_xunlock(&sc->dev_lock); + return (EPERM); + } bytes_to_transfer = MIN(sc->pending_data_length, uio->uio_resid); if (bytes_to_transfer > 0) { @@ -128,9 +132,11 @@ tpm20_write(struct cdev *dev, struct uio *uio, int fla result = sc->transmit(sc, byte_count); - if (result == 0) + if (result == 0) { callout_reset(&sc->discard_buffer_callout, TPM_READ_TIMEOUT / tick, tpm20_discard_buffer, sc); + sc->owner_tid = uio->uio_td->td_tid; + } sx_xunlock(&sc->dev_lock); return (result); Modified: head/sys/dev/tpm/tpm20.h ============================================================================== --- head/sys/dev/tpm/tpm20.h Tue Apr 16 02:12:38 2019 (r346258) +++ head/sys/dev/tpm/tpm20.h Tue Apr 16 02:28:35 2019 (r346259) @@ -120,6 +120,7 @@ struct tpm_sc { uint8_t *buf; size_t pending_data_length; + lwpid_t owner_tid; struct callout discard_buffer_callout; #ifdef TPM_HARVEST From owner-svn-src-head@freebsd.org Tue Apr 16 02:46:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6750F1585444; Tue, 16 Apr 2019 02:46:23 +0000 (UTC) (envelope-from mw@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 08B536EE38; Tue, 16 Apr 2019 02:46:23 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB31819515; Tue, 16 Apr 2019 02:46:22 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3G2kMm8067429; Tue, 16 Apr 2019 02:46:22 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G2kMpk067425; Tue, 16 Apr 2019 02:46:22 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201904160246.x3G2kMpk067425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 16 Apr 2019 02:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346261 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 346261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08B536EE38 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,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, 16 Apr 2019 02:46:23 -0000 Author: mw Date: Tue Apr 16 02:46:21 2019 New Revision: 346261 URL: https://svnweb.freebsd.org/changeset/base/346261 Log: Improve tpm20 style No functional changes to the code are applied. Submitted by: Kornel Duleba Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/dev/tpm/tpm20.c head/sys/dev/tpm/tpm20.h head/sys/dev/tpm/tpm_crb.c head/sys/dev/tpm/tpm_tis.c Modified: head/sys/dev/tpm/tpm20.c ============================================================================== --- head/sys/dev/tpm/tpm20.c Tue Apr 16 02:38:39 2019 (r346260) +++ head/sys/dev/tpm/tpm20.c Tue Apr 16 02:46:21 2019 (r346261) @@ -142,7 +142,8 @@ tpm20_write(struct cdev *dev, struct uio *uio, int fla return (result); } -static void tpm20_discard_buffer(void *arg) +static void +tpm20_discard_buffer(void *arg) { struct tpm_sc *sc; @@ -304,9 +305,10 @@ tpm20_save_state(device_t dev, bool suspend) { struct tpm_sc *sc; uint8_t save_cmd[] = { - 0x80, 0x01, /* TPM_ST_NO_SESSIONS tag*/ + 0x80, 0x01, /* TPM_ST_NO_SESSIONS tag*/ 0x00, 0x00, 0x00, 0x0C, /* cmd length */ - 0x00, 0x00, 0x01, 0x45, 0x00, 0x00 /* cmd TPM_CC_Shutdown */ + 0x00, 0x00, 0x01, 0x45, /* cmd TPM_CC_Shutdown */ + 0x00, 0x00 /* TPM_SU_STATE */ }; sc = device_get_softc(dev); @@ -315,7 +317,7 @@ tpm20_save_state(device_t dev, bool suspend) * Inform the TPM whether we are going to suspend or reboot/shutdown. */ if (suspend) - save_cmd[11] = 1; /* TPM_SU_STATE */ + save_cmd[11] = 1; /* TPM_SU_STATE */ if (sc == NULL || sc->buf == NULL) return (0); Modified: head/sys/dev/tpm/tpm20.h ============================================================================== --- head/sys/dev/tpm/tpm20.h Tue Apr 16 02:38:39 2019 (r346260) +++ head/sys/dev/tpm/tpm20.h Tue Apr 16 02:46:21 2019 (r346261) @@ -26,7 +26,7 @@ */ #ifndef _TPM20_H_ -#define _TPM20_H_ +#define _TPM20_H_ #include __FBSDID("$FreeBSD$"); @@ -60,46 +60,46 @@ __FBSDID("$FreeBSD$"); #define BIT(x) (1 << (x)) /* Timeouts in us */ -#define TPM_TIMEOUT_A 750000 -#define TPM_TIMEOUT_B 2000000 -#define TPM_TIMEOUT_C 200000 -#define TPM_TIMEOUT_D 30000 +#define TPM_TIMEOUT_A 750000 +#define TPM_TIMEOUT_B 2000000 +#define TPM_TIMEOUT_C 200000 +#define TPM_TIMEOUT_D 30000 /* * Generating RSA key pair takes ~(10-20s), which is significantly longer than * any timeout defined in spec. Because of that we need a new one. */ -#define TPM_TIMEOUT_LONG 40000000 +#define TPM_TIMEOUT_LONG 40000000 /* List of commands that require TPM_TIMEOUT_LONG time to complete */ -#define TPM_CC_CreatePrimary 0x00000131 +#define TPM_CC_CreatePrimary 0x00000131 #define TPM_CC_Create 0x00000153 #define TPM_CC_CreateLoaded 0x00000191 /* List of commands that require only TPM_TIMEOUT_C time to complete */ -#define TPM_CC_SequenceComplete 0x0000013e -#define TPM_CC_Startup 0x00000144 -#define TPM_CC_SequenceUpdate 0x0000015c -#define TPM_CC_GetCapability 0x0000017a -#define TPM_CC_PCR_Extend 0x00000182 -#define TPM_CC_EventSequenceComplete 0x00000185 -#define TPM_CC_HashSequenceStart 0x00000186 +#define TPM_CC_SequenceComplete 0x0000013e +#define TPM_CC_Startup 0x00000144 +#define TPM_CC_SequenceUpdate 0x0000015c +#define TPM_CC_GetCapability 0x0000017a +#define TPM_CC_PCR_Extend 0x00000182 +#define TPM_CC_EventSequenceComplete 0x00000185 +#define TPM_CC_HashSequenceStart 0x00000186 /* Timeout before data in read buffer is discarded */ -#define TPM_READ_TIMEOUT 500000 +#define TPM_READ_TIMEOUT 500000 -#define TPM_BUFSIZE 0x1000 +#define TPM_BUFSIZE 0x1000 -#define TPM_HEADER_SIZE 10 +#define TPM_HEADER_SIZE 10 -#define TPM_CDEV_NAME "tpm0" -#define TPM_CDEV_PERM_FLAG 0600 +#define TPM_CDEV_NAME "tpm0" +#define TPM_CDEV_PERM_FLAG 0600 -#define TPM2_START_METHOD_ACPI 2 -#define TPM2_START_METHOD_TIS 6 -#define TPM2_START_METHOD_CRB 7 -#define TPM2_START_METHOD_CRB_ACPI 8 +#define TPM2_START_METHOD_ACPI 2 +#define TPM2_START_METHOD_TIS 6 +#define TPM2_START_METHOD_CRB 7 +#define TPM2_START_METHOD_CRB_ACPI 8 struct tpm_sc { device_t dev; Modified: head/sys/dev/tpm/tpm_crb.c ============================================================================== --- head/sys/dev/tpm/tpm_crb.c Tue Apr 16 02:38:39 2019 (r346260) +++ head/sys/dev/tpm/tpm_crb.c Tue Apr 16 02:46:21 2019 (r346261) @@ -34,47 +34,47 @@ __FBSDID("$FreeBSD$"); * CRB register space as defined in * TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22 */ -#define TPM_LOC_STATE 0x0 -#define TPM_LOC_CTRL 0x8 -#define TPM_LOC_STS 0xC -#define TPM_CRB_INTF_ID 0x30 -#define TPM_CRB_CTRL_EXT 0x38 -#define TPM_CRB_CTRL_REQ 0x40 -#define TPM_CRB_CTRL_STS 0x44 -#define TPM_CRB_CTRL_CANCEL 0x48 -#define TPM_CRB_CTRL_START 0x4C -#define TPM_CRB_INT_ENABLE 0x50 -#define TPM_CRB_INT_STS 0x54 -#define TPM_CRB_CTRL_CMD_SIZE 0x58 -#define TPM_CRB_CTRL_CMD_LADDR 0x5C -#define TPM_CRB_CTRL_CMD_HADDR 0x60 -#define TPM_CRB_CTRL_RSP_SIZE 0x64 -#define TPM_CRB_CTRL_RSP_ADDR 0x68 -#define TPM_CRB_CTRL_RSP_HADDR 0x6c -#define TPM_CRB_DATA_BUFFER 0x80 +#define TPM_LOC_STATE 0x0 +#define TPM_LOC_CTRL 0x8 +#define TPM_LOC_STS 0xC +#define TPM_CRB_INTF_ID 0x30 +#define TPM_CRB_CTRL_EXT 0x38 +#define TPM_CRB_CTRL_REQ 0x40 +#define TPM_CRB_CTRL_STS 0x44 +#define TPM_CRB_CTRL_CANCEL 0x48 +#define TPM_CRB_CTRL_START 0x4C +#define TPM_CRB_INT_ENABLE 0x50 +#define TPM_CRB_INT_STS 0x54 +#define TPM_CRB_CTRL_CMD_SIZE 0x58 +#define TPM_CRB_CTRL_CMD_LADDR 0x5C +#define TPM_CRB_CTRL_CMD_HADDR 0x60 +#define TPM_CRB_CTRL_RSP_SIZE 0x64 +#define TPM_CRB_CTRL_RSP_ADDR 0x68 +#define TPM_CRB_CTRL_RSP_HADDR 0x6c +#define TPM_CRB_DATA_BUFFER 0x80 -#define TPM_LOC_STATE_ESTB BIT(0) -#define TPM_LOC_STATE_ASSIGNED BIT(1) -#define TPM_LOC_STATE_ACTIVE_MASK 0x9C -#define TPM_LOC_STATE_VALID BIT(7) +#define TPM_LOC_STATE_ESTB BIT(0) +#define TPM_LOC_STATE_ASSIGNED BIT(1) +#define TPM_LOC_STATE_ACTIVE_MASK 0x9C +#define TPM_LOC_STATE_VALID BIT(7) -#define TPM_CRB_INTF_ID_TYPE_CRB 0x1 -#define TPM_CRB_INTF_ID_TYPE 0x7 +#define TPM_CRB_INTF_ID_TYPE_CRB 0x1 +#define TPM_CRB_INTF_ID_TYPE 0x7 -#define TPM_LOC_CTRL_REQUEST BIT(0) -#define TPM_LOC_CTRL_RELINQUISH BIT(1) +#define TPM_LOC_CTRL_REQUEST BIT(0) +#define TPM_LOC_CTRL_RELINQUISH BIT(1) -#define TPM_CRB_CTRL_REQ_GO_READY BIT(0) -#define TPM_CRB_CTRL_REQ_GO_IDLE BIT(1) +#define TPM_CRB_CTRL_REQ_GO_READY BIT(0) +#define TPM_CRB_CTRL_REQ_GO_IDLE BIT(1) -#define TPM_CRB_CTRL_STS_ERR_BIT BIT(0) -#define TPM_CRB_CTRL_STS_IDLE_BIT BIT(1) +#define TPM_CRB_CTRL_STS_ERR_BIT BIT(0) +#define TPM_CRB_CTRL_STS_IDLE_BIT BIT(1) -#define TPM_CRB_CTRL_CANCEL_CMD BIT(0) +#define TPM_CRB_CTRL_CANCEL_CMD BIT(0) -#define TPM_CRB_CTRL_START_CMD BIT(0) +#define TPM_CRB_CTRL_START_CMD BIT(0) -#define TPM_CRB_INT_ENABLE_BIT BIT(31) +#define TPM_CRB_INT_ENABLE_BIT BIT(31) struct tpmcrb_sc { struct tpm_sc base; Modified: head/sys/dev/tpm/tpm_tis.c ============================================================================== --- head/sys/dev/tpm/tpm_tis.c Tue Apr 16 02:38:39 2019 (r346260) +++ head/sys/dev/tpm/tpm_tis.c Tue Apr 16 02:46:21 2019 (r346261) @@ -34,45 +34,45 @@ __FBSDID("$FreeBSD$"); * TIS register space as defined in * TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22 */ -#define TPM_ACCESS 0x0 -#define TPM_INT_ENABLE 0x8 -#define TPM_INT_VECTOR 0xc -#define TPM_INT_STS 0x10 -#define TPM_INTF_CAPS 0x14 -#define TPM_STS 0x18 -#define TPM_DATA_FIFO 0x24 -#define TPM_INTF_ID 0x30 -#define TPM_XDATA_FIFO 0x80 -#define TPM_DID_VID 0xF00 -#define TPM_RID 0xF04 +#define TPM_ACCESS 0x0 +#define TPM_INT_ENABLE 0x8 +#define TPM_INT_VECTOR 0xc +#define TPM_INT_STS 0x10 +#define TPM_INTF_CAPS 0x14 +#define TPM_STS 0x18 +#define TPM_DATA_FIFO 0x24 +#define TPM_INTF_ID 0x30 +#define TPM_XDATA_FIFO 0x80 +#define TPM_DID_VID 0xF00 +#define TPM_RID 0xF04 -#define TPM_ACCESS_LOC_REQ BIT(1) -#define TPM_ACCESS_LOC_Seize BIT(3) -#define TPM_ACCESS_LOC_ACTIVE BIT(5) -#define TPM_ACCESS_LOC_RELINQUISH BIT(5) -#define TPM_ACCESS_VALID BIT(7) +#define TPM_ACCESS_LOC_REQ BIT(1) +#define TPM_ACCESS_LOC_Seize BIT(3) +#define TPM_ACCESS_LOC_ACTIVE BIT(5) +#define TPM_ACCESS_LOC_RELINQUISH BIT(5) +#define TPM_ACCESS_VALID BIT(7) -#define TPM_INT_ENABLE_GLOBAL_ENABLE BIT(31) -#define TPM_INT_ENABLE_CMD_RDY BIT(7) -#define TPM_INT_ENABLE_LOC_CHANGE BIT(2) -#define TPM_INT_ENABLE_STS_VALID BIT(1) -#define TPM_INT_ENABLE_DATA_AVAIL BIT(0) +#define TPM_INT_ENABLE_GLOBAL_ENABLE BIT(31) +#define TPM_INT_ENABLE_CMD_RDY BIT(7) +#define TPM_INT_ENABLE_LOC_CHANGE BIT(2) +#define TPM_INT_ENABLE_STS_VALID BIT(1) +#define TPM_INT_ENABLE_DATA_AVAIL BIT(0) -#define TPM_INT_STS_CMD_RDY BIT(7) -#define TPM_INT_STS_LOC_CHANGE BIT(2) -#define TPM_INT_STS_VALID BIT(1) -#define TPM_INT_STS_DATA_AVAIL BIT(0) +#define TPM_INT_STS_CMD_RDY BIT(7) +#define TPM_INT_STS_LOC_CHANGE BIT(2) +#define TPM_INT_STS_VALID BIT(1) +#define TPM_INT_STS_DATA_AVAIL BIT(0) -#define TPM_INTF_CAPS_VERSION 0x70000000 -#define TPM_INTF_CAPS_TPM20 0x30000000 +#define TPM_INTF_CAPS_VERSION 0x70000000 +#define TPM_INTF_CAPS_TPM20 0x30000000 -#define TPM_STS_VALID BIT(7) -#define TPM_STS_CMD_RDY BIT(6) -#define TPM_STS_CMD_START BIT(5) -#define TPM_STS_DATA_AVAIL BIT(4) -#define TPM_STS_DATA_EXPECTED BIT(3) -#define TPM_STS_BURST_MASK 0xFFFF00 -#define TPM_STS_BURST_OFFSET 0x8 +#define TPM_STS_VALID BIT(7) +#define TPM_STS_CMD_RDY BIT(6) +#define TPM_STS_CMD_START BIT(5) +#define TPM_STS_DATA_AVAIL BIT(4) +#define TPM_STS_DATA_EXPECTED BIT(3) +#define TPM_STS_BURST_MASK 0xFFFF00 +#define TPM_STS_BURST_OFFSET 0x8 static int tpmtis_transmit(struct tpm_sc *sc, size_t length); @@ -93,6 +93,7 @@ static bool tpmtis_go_ready(struct tpm_sc *sc); static bool tpm_wait_for_u32(struct tpm_sc *sc, bus_size_t off, uint32_t mask, uint32_t val, int32_t timeout); + static uint16_t tpmtis_wait_for_burst(struct tpm_sc *sc); char *tpmtis_ids[] = {"MSFT0101", NULL}; From owner-svn-src-head@freebsd.org Tue Apr 16 04:12:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC52C1588343; Tue, 16 Apr 2019 04:12:42 +0000 (UTC) (envelope-from oshogbo@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 8A8447269A; Tue, 16 Apr 2019 04:12:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6121F1A565; Tue, 16 Apr 2019 04:12:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3G4Cge2015093; Tue, 16 Apr 2019 04:12:42 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G4CgN2015092; Tue, 16 Apr 2019 04:12:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904160412.x3G4CgN2015092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 16 Apr 2019 04:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346263 - head/contrib/tcpdump X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/contrib/tcpdump X-SVN-Commit-Revision: 346263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A8447269A 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)[-1.000,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: Tue, 16 Apr 2019 04:12:43 -0000 Author: oshogbo Date: Tue Apr 16 04:12:41 2019 New Revision: 346263 URL: https://svnweb.freebsd.org/changeset/base/346263 Log: tcpdump: disable Capsicum if -E option is provided. The -E is used to provide a secret for decrypting IPsec. The secret may be provided through command line or as the file. The problem is that tcpdump doesn't support yet opening files in capability mode and the file may contain a list of the files to open. As a workaround, for now, let's just disable capsicum if the -E the option is provided. PR: 236819 MFC after: 2 weeks Modified: head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Tue Apr 16 02:48:04 2019 (r346262) +++ head/contrib/tcpdump/tcpdump.c Tue Apr 16 04:12:41 2019 (r346263) @@ -2063,7 +2063,8 @@ main(int argc, char **argv) } #ifdef HAVE_CAPSICUM - cansandbox = (VFileName == NULL && zflag == NULL); + cansandbox = (VFileName == NULL && zflag == NULL && + ndo->ndo_espsecret == NULL); #ifdef HAVE_CASPER cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL)); #else From owner-svn-src-head@freebsd.org Tue Apr 16 05:11:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B16E9158944E; Tue, 16 Apr 2019 05:11:40 +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 4F5E57429D; Tue, 16 Apr 2019 05:11:40 +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 2B4DC1AF4C; Tue, 16 Apr 2019 05:11:40 +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 x3G5Be0J043627; Tue, 16 Apr 2019 05:11:40 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G5BdGv043626; Tue, 16 Apr 2019 05:11:39 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201904160511.x3G5BdGv043626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 16 Apr 2019 05:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346264 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 346264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F5E57429D 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)[-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: Tue, 16 Apr 2019 05:11:40 -0000 Author: cy Date: Tue Apr 16 05:11:39 2019 New Revision: 346264 URL: https://svnweb.freebsd.org/changeset/base/346264 Log: Document when I received my commit bits. Modified: head/share/misc/committers-ports.dot head/share/misc/committers-src.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Apr 16 04:12:41 2019 (r346263) +++ head/share/misc/committers-ports.dot Tue Apr 16 05:11:39 2019 (r346264) @@ -84,6 +84,7 @@ cperciva [label="Colin Percival\ncperciva@FreeBSD.org\ crees [label="Chris Rees\ncrees@FreeBSD.org\n2011/06/11"] cs [label="Carlo Strub\ncs@FreeBSD.org\n2011/09/13"] culot [label="Frederic Culot\nculot@FreeBSD.org\n2010/10/16"] +cy [label="Cy Schubert\ncy@FreeBSD.org\n2001/11/13"] daichi [label="Daichi Goto\ndaichi@FreeBSD.org\n2002/10/17"] danfe [label="Alexey Dokuchaev\ndanfe@FreeBSD.org\n2004/08/20"] danilo [label="Danilo E. Gondolfo\ndanilo@FreeBSD.org\n2013/09/23"] Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Apr 16 04:12:41 2019 (r346263) +++ head/share/misc/committers-src.dot Tue Apr 16 05:11:39 2019 (r346264) @@ -143,6 +143,7 @@ cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2 cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"] cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] csjp [label="Christian S.J. Peron\ncsjp@FreeBSD.org\n2004/05/04"] +cy [label="Cy Schubert\ncy@FreeBSD.org\n2013/04/23"] dab [label="David Bright\ndab@FreeBSD.org\n2016/10/24"] das [label="David Schultz\ndas@FreeBSD.org\n2003/02/21"] davide [label="Davide Italiano\ndavide@FreeBSD.org\n2012/01/27"] From owner-svn-src-head@freebsd.org Tue Apr 16 09:42:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DA5A156B920; Tue, 16 Apr 2019 09:42:43 +0000 (UTC) (envelope-from peterj@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 C0C1E845CB; Tue, 16 Apr 2019 09:42:42 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C9991DDAA; Tue, 16 Apr 2019 09:42:42 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3G9gg9w086683; Tue, 16 Apr 2019 09:42:42 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G9gg2S086682; Tue, 16 Apr 2019 09:42:42 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201904160942.x3G9gg2S086682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Tue, 16 Apr 2019 09:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346265 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 346265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0C1E845CB 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.938,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 16 Apr 2019 09:42:43 -0000 Author: peterj Date: Tue Apr 16 09:42:42 2019 New Revision: 346265 URL: https://svnweb.freebsd.org/changeset/base/346265 Log: Fix cpufreq(4) on RPI-B Since r324184 the root node compatible for the original Raspberry Pi is "brcm,bcm2835", add it to the compatible list of bcm2835_cpufreq. Tested On: RPi1 Model B Note that the default Das U-Boot FDT does not include a cpus clause so actually adding a bcm2835_cpufreq device requires adding a FDT overlay defining the cpu. Approved by: grog, jhb (mentors) MFC after: 3 days Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Tue Apr 16 05:11:39 2019 (r346264) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Tue Apr 16 09:42:42 2019 (r346265) @@ -126,6 +126,7 @@ static struct ofw_compat_data compat_data[] = { { "broadcom,bcm2835-vc", 1 }, { "broadcom,bcm2708-vc", 1 }, { "brcm,bcm2709", 1 }, + { "brcm,bcm2835", 1 }, { "brcm,bcm2836", 1 }, { "brcm,bcm2837", 1 }, { NULL, 0 } From owner-svn-src-head@freebsd.org Tue Apr 16 09:44:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C74B156B9F7; Tue, 16 Apr 2019 09:44:47 +0000 (UTC) (envelope-from peterj@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 32D828474E; Tue, 16 Apr 2019 09:44:47 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 087951DDAC; Tue, 16 Apr 2019 09:44:47 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3G9ikTM086826; Tue, 16 Apr 2019 09:44:46 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G9ik8g086825; Tue, 16 Apr 2019 09:44:46 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201904160944.x3G9ik8g086825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Tue, 16 Apr 2019 09:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346266 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 346266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32D828474E 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,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, 16 Apr 2019 09:44:47 -0000 Author: peterj Date: Tue Apr 16 09:44:46 2019 New Revision: 346266 URL: https://svnweb.freebsd.org/changeset/base/346266 Log: Specify correct Ethernet phy for RPI-B Correct a typo in the RPI-B ethernet config - the RPi-B includes a SMC LAN9512 USB bridge and Ethernet 10/100 NIC/phy. The phy part of this is supported by smscphy. Tested On: RPi1 Model B Approved by: grog, jhb (mentors) MFC after: 3 days Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue Apr 16 09:42:42 2019 (r346265) +++ head/sys/arm/conf/RPI-B Tue Apr 16 09:44:46 2019 (r346266) @@ -77,7 +77,7 @@ device da device umass # USB ethernet support -device smcphy +device smscphy device mii device smsc From owner-svn-src-head@freebsd.org Tue Apr 16 11:20:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1E66156E825; Tue, 16 Apr 2019 11:20:14 +0000 (UTC) (envelope-from fsu@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 53B9487A63; Tue, 16 Apr 2019 11:20:14 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D6E11ED29; Tue, 16 Apr 2019 11:20:14 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GBKEsB036423; Tue, 16 Apr 2019 11:20:14 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GBKBhN036407; Tue, 16 Apr 2019 11:20:11 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201904161120.x3GBKBhN036407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Tue, 16 Apr 2019 11:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346267 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 346267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53B9487A63 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)[-1.000,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: Tue, 16 Apr 2019 11:20:15 -0000 Author: fsu Date: Tue Apr 16 11:20:10 2019 New Revision: 346267 URL: https://svnweb.freebsd.org/changeset/base/346267 Log: ext2fs: Initial version of DTrace support. Reviewed by: pfg, gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19848 Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_csum.c head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_hash.c head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/fs.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_alloc.c Tue Apr 16 11:20:10 2019 (r346267) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,23 @@ #include #include +SDT_PROVIDER_DEFINE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , alloc, trace, "int", "char*"); +SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_reallocblks_realloc, + "ino_t", "e2fs_lbn_t", "e2fs_lbn_t"); +SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_bap, "uint32_t"); +SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_blkno, "e2fs_daddr_t"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, "char*", "int"); +SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, + "int", "daddr_t", "char*"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_blkfree_bad_block, "ino_t", "e4fs_daddr_t"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_vfree_doublefree, "char*", "ino_t"); + static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int); static daddr_t ext2_clusteralloc(struct inode *, int, daddr_t, int); static u_long ext2_dirpref(struct inode *); @@ -128,8 +146,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t } nospace: EXT2_UNLOCK(ump); - ext2_fserr(fs, cred->cr_uid, "filesystem full"); - uprintf("\n%s: write failed, filesystem is full\n", fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate data block"); return (ENOSPC); } @@ -147,8 +164,10 @@ ext2_alloc_meta(struct inode *ip) EXT2_LOCK(ip->i_ump); blk = ext2_hashalloc(ip, ino_to_cg(fs, ip->i_number), 0, fs->e2fs_bsize, ext2_alloccg); - if (0 == blk) + if (0 == blk) { EXT2_UNLOCK(ip->i_ump); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate meta block"); + } return (blk); } @@ -289,10 +308,8 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) * block pointers in the inode and indirect blocks associated * with the file. */ -#ifdef DEBUG - printf("realloc: ino %ju, lbns %jd-%jd\n\told:", - (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); -#endif /* DEBUG */ + SDT_PROBE3(ext2fs, , alloc, ext2_reallocblks_realloc, + ip->i_number, start_lbn, end_lbn); blkno = newblk; for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) { if (i == ssize) { @@ -303,9 +320,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap)) panic("ext2_reallocblks: alloc mismatch"); #endif -#ifdef DEBUG - printf(" %d,", *bap); -#endif /* DEBUG */ + SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_bap, *bap); *bap++ = blkno; } /* @@ -341,20 +356,13 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) /* * Last, free the old blocks and assign the new blocks to the buffers. */ -#ifdef DEBUG - printf("\n\tnew:"); -#endif /* DEBUG */ for (blkno = newblk, i = 0; i < len; i++, blkno += fs->e2fs_fpb) { ext2_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->e2fs_bsize); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); -#ifdef DEBUG - printf(" %d,", blkno); -#endif /* DEBUG */ + SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_blkno, blkno); } -#ifdef DEBUG - printf("\n"); -#endif /* DEBUG */ + return (0); fail: @@ -481,8 +489,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred noinodes: EXT2_UNLOCK(ump); - ext2_fserr(fs, cred->cr_uid, "out of inodes"); - uprintf("\n%s: create/symlink failed, no inodes free\n", fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "out of inodes"); return (ENOSPC); } @@ -959,21 +966,24 @@ ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf /* Check block bitmap block number */ offset = e2fs_gd_get_b_bitmap(gd) - group_first_block; if (offset >= max_bit || !isset(bp->b_data, offset)) { - printf("ext2fs: bad block bitmap, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad block bitmap, group", cg); return (EINVAL); } /* Check inode bitmap block number */ offset = e2fs_gd_get_i_bitmap(gd) - group_first_block; if (offset >= max_bit || !isset(bp->b_data, offset)) { - printf("ext2fs: bad inode bitmap, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad inode bitmap", cg); return (EINVAL); } /* Check inode table */ offset = e2fs_gd_get_i_tables(gd) - group_first_block; if (offset >= max_bit || offset + fs->e2fs_itpg >= max_bit) { - printf("ext2fs: bad inode table, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad inode table, group", cg); return (EINVAL); } @@ -1350,9 +1360,8 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr start = 0; loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { - printf("ext2fs: inode bitmap corrupted: " - "cg = %d, ipref = %lld, fs = %s - run fsck\n", - cg, (long long)ipref, fs->e2fs_fsmnt); + SDT_PROBE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, + cg, ipref, fs->e2fs_fsmnt); brelse(bp); EXT2_LOCK(ump); return (0); @@ -1401,9 +1410,7 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long ump = ip->i_ump; cg = dtog(fs, bno); if (bno >= fs->e2fs_bcount) { - printf("bad block %lld, ino %ju\n", (long long)bno, - (uintmax_t)ip->i_number); - ext2_fserr(fs, ip->i_uid, "bad block"); + SDT_PROBE2(ext2fs, , alloc, ext2_blkfree_bad_block, ip->i_number, bno); return; } error = bread(ip->i_devvp, @@ -1416,9 +1423,8 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long bbp = (char *)bp->b_data; bno = dtogd(fs, bno); if (isclr(bbp, bno)) { - printf("block = %lld, fs = %s\n", + panic("ext2_blkfree: freeing free block %lld, fs=%s", (long long)bno, fs->e2fs_fsmnt); - panic("ext2_blkfree: freeing free block"); } clrbit(bbp, bno); EXT2_LOCK(ump); @@ -1464,8 +1470,8 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) ibp = (char *)bp->b_data; ino = (ino - 1) % fs->e2fs->e2fs_ipg; if (isclr(ibp, ino)) { - printf("ino = %ju, fs = %s\n", - ino, fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, ext2_vfree_doublefree, + fs->e2fs_fsmnt, ino); if (fs->e2fs_ronly == 0) panic("ext2_vfree: freeing free inode"); } @@ -1513,26 +1519,12 @@ ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t start = 0; loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { - printf("start = %d, len = %d, fs = %s\n", + panic("ext2_mapsearch: map corrupted: start=%d, len=%d, fs=%s", start, len, fs->e2fs_fsmnt); - panic("ext2_mapsearch: map corrupted"); /* NOTREACHED */ } } return ((loc - bbp) * NBBY + ffs(~*loc) - 1); -} - -/* - * Fserr prints the name of a filesystem with an error diagnostic. - * - * The form of the error message is: - * fs: error message - */ -void -ext2_fserr(struct m_ext2fs *fs, uid_t uid, char *cp) -{ - - log(LOG_ERR, "uid %u on %s: %s\n", uid, fs->e2fs_fsmnt, cp); } int Modified: head/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- head/sys/fs/ext2fs/ext2_csum.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_csum.c Tue Apr 16 11:20:10 2019 (r346267) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, csum, "int", "char*"); + #define EXT2_BG_INODE_BITMAP_CSUM_HI_END \ (offsetof(struct ext2_gd, ext4bgd_i_bmap_csum_hi) + \ sizeof(uint16_t)) @@ -134,8 +143,7 @@ ext2_extattr_blk_csum_verify(struct inode *ip, struct if (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_METADATA_CKSUM) && (header->h_checksum != ext2_extattr_blk_csum(ip, ip->i_facl, header))) { - printf("WARNING: bad extattr csum detected, ip=%lu - run fsck\n", - (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad extattr csum detected"); return (EIO); } @@ -351,8 +359,7 @@ ext2_dir_blk_csum_verify(struct inode *ip, struct buf error = ext2_dx_csum_verify(ip, ep); if (error) - printf("WARNING: bad directory csum detected, ip=%lu" - " - run fsck\n", (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad directory csum detected"); return (error); } @@ -445,8 +452,7 @@ ext2_extent_blk_csum_verify(struct inode *ip, void *da calculated = ext2_extent_blk_csum(ip, ehp); if (provided != calculated) { - printf("WARNING: bad extent csum detected, ip=%lu - run fsck\n", - (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad extent csum detected"); return (EIO); } @@ -491,8 +497,7 @@ ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *fs, int calculated &= 0xFFFF; if (provided != calculated) { - printf("WARNING: bad inode bitmap csum detected, " - "cg=%d - run fsck\n", cg); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad inode bitmap csum detected"); return (EIO); } @@ -532,8 +537,7 @@ ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *fs, int calculated &= 0xFFFF; if (provided != calculated) { - printf("WARNING: bad block bitmap csum detected, " - "cg=%d - run fsck\n", cg); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad block bitmap csum detected"); return (EIO); } @@ -629,7 +633,7 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di if (!memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) return (0); - printf("WARNING: Bad inode %ju csum - run fsck\n", ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad inode csum"); return (EIO); } Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_extattr.c Tue Apr 16 11:20:10 2019 (r346267) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, extattr, "int", "char*"); + static int ext2_extattr_attrnamespace_to_bsd(int attrnamespace) { @@ -89,9 +98,8 @@ ext2_extattr_name_to_bsd(int attrnamespace, const char * XXX: Not all linux namespaces are mapped to bsd for now, * return NULL, which will be converted to ENOTSUP on upper layer. */ -#ifdef EXT2FS_DEBUG - printf("can not convert ext2fs name to bsd: namespace=%d\n", attrnamespace); -#endif + SDT_PROBE2(ext2fs, , trace, extattr, 1, + "can not convert ext2fs name to bsd namespace"); return (NULL); } Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_extents.h Tue Apr 16 11:20:10 2019 (r346267) @@ -129,7 +129,7 @@ int ext4_ext_remove_space(struct inode *ip, off_t leng int ext4_ext_get_blocks(struct inode *ip, int64_t iblock, unsigned long max_blocks, struct ucred *cred, struct buf **bpp, int *allocate, daddr_t *); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext4_ext_print_extent_tree_status(struct inode *ip); #endif Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_extern.h Tue Apr 16 11:20:10 2019 (r346267) @@ -66,7 +66,6 @@ int ext2_bmaparray(struct vnode *, daddr_t, daddr_t *, int ext4_bmapext(struct vnode *, int32_t, int64_t *, int *, int *); void ext2_clusteracct(struct m_ext2fs *, char *, int, e4fs_daddr_t, int); void ext2_dirbad(struct inode *ip, doff_t offset, char *how); -void ext2_fserr(struct m_ext2fs *, uid_t, char *); int ext2_ei2i(struct ext2fs_dinode *, struct inode *); int ext2_getlbns(struct vnode *, daddr_t, struct indir *, int *); int ext2_i2ei(struct inode *, struct ext2fs_dinode *); @@ -80,7 +79,7 @@ int ext2_vfree(struct vnode *, ino_t, int); int ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp); int ext2_lookup(struct vop_cachedlookup_args *); int ext2_readdir(struct vop_readdir_args *); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext2_print_inode(struct inode *); #endif int ext2_direnter(struct inode *, Modified: head/sys/fs/ext2fs/ext2_hash.c ============================================================================== --- head/sys/fs/ext2fs/ext2_hash.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_hash.c Tue Apr 16 11:20:10 2019 (r346267) @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, hash, "int", "char*"); + /* F, G, and H are MD4 functions */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) @@ -300,6 +309,7 @@ ext2_htree_hash(const char *name, int len, minor = hash[2]; break; default: + SDT_PROBE2(ext2fs, , trace, hash, 1, "unexpected hash version"); goto error; } Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_htree.c Tue Apr 16 11:20:10 2019 (r346267) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -54,6 +55,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, htree, "int", "char*"); + static void ext2_append_entry(char *block, uint32_t blksize, struct ext2fs_direct_2 *last_entry, struct ext2fs_direct_2 *new_entry, int csum_size); @@ -816,7 +825,8 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ if (ext2_htree_get_count(root_entires) == ext2_htree_get_limit(root_entires)) { - /* Directory index is full */ + SDT_PROBE2(ext2fs, , trace, htree, 1, + "directory index is full"); error = EIO; goto finish; } Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_inode.c Tue Apr 16 11:20:10 2019 (r346267) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Tue Apr 16 11:20:10 2019 (r346267) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -40,10 +41,18 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, inode_cnv, "int", "char*"); + #define XTIME_TO_NSEC(x) ((x & EXT3_NSEC_MASK) >> 2) #define NSEC_TO_XTIME(t) (le32toh(t << 2) & EXT3_NSEC_MASK) -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext2_print_inode(struct inode *in) { @@ -83,7 +92,7 @@ ext2_print_inode(struct inode *in) printf("\n"); } } -#endif /* EXT2FS_DEBUG */ +#endif /* EXT2FS_PRINT_EXTENTS */ /* * raw ext2 inode to inode @@ -96,12 +105,12 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) if ((ip->i_number < EXT2_FIRST_INO(fs) && ip->i_number != EXT2_ROOTINO) || (ip->i_number < EXT2_ROOTINO) || (ip->i_number > fs->e2fs->e2fs_icount)) { - printf("ext2fs: bad inode number %ju\n", ip->i_number); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "bad inode number"); return (EINVAL); } if (ip->i_number == EXT2_ROOTINO && ei->e2di_nlink == 0) { - printf("ext2fs: root inode unallocated\n"); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "root inode unallocated"); return (EINVAL); } ip->i_nlink = ei->e2di_nlink; @@ -110,8 +119,8 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) if (EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE) { if (E2FS_REV0_INODE_SIZE + ei->e2di_extra_isize > EXT2_INODE_SIZE(fs) || (ei->e2di_extra_isize & 3)) { - printf("ext2fs: bad extra inode size %u, inode size=%u\n", - ei->e2di_extra_isize, EXT2_INODE_SIZE(fs)); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, + "bad extra inode size"); return (EINVAL); } } @@ -199,7 +208,7 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS : 0; if (ip->i_blocks > ~0U && !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_HUGE_FILE)) { - ext2_fserr(fs, ip->i_uid, "i_blocks value is out of range"); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "i_blocks value is out of range"); return (EIO); } if (ip->i_blocks <= 0xffffffffffffULL) { Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Apr 16 11:20:10 2019 (r346267) @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -66,6 +67,18 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , lookup, trace, "int", "char*"); +SDT_PROBE_DEFINE4(ext2fs, , trace, ext2_dirbad_error, + "char*", "ino_t", "doff_t", "char*"); +SDT_PROBE_DEFINE5(ext2fs, , trace, ext2_dirbadentry_error, + "char*", "int", "uint32_t", "uint16_t", "uint8_t"); + #ifdef INVARIANTS static int dirchk = 1; #else @@ -810,10 +823,8 @@ ext2_dirbad(struct inode *ip, doff_t offset, char *how mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, (long)offset, how); else - (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, - (long)offset, how); - + SDT_PROBE4(ext2fs, , trace, ext2_dirbad_error, + mp->mnt_stat.f_mntonname, ip->i_number, offset, how); } /* @@ -849,10 +860,9 @@ ext2_dirbadentry(struct vnode *dp, struct ext2fs_direc */ if (error_msg != NULL) { - printf("bad directory entry: %s\n", error_msg); - printf("offset=%d, inode=%lu, rec_len=%u, name_len=%u\n", - entryoffsetinblock, (unsigned long)de->e2d_ino, - de->e2d_reclen, de->e2d_namlen); + SDT_PROBE5(ext2fs, , trace, ext2_dirbadentry_error, + error_msg, entryoffsetinblock, + de->e2d_ino, de->e2d_reclen, de->e2d_namlen); } return error_msg == NULL ? 0 : 1; } @@ -1276,7 +1286,8 @@ ext2_checkpath(struct inode *source, struct inode *tar out: if (error == ENOTDIR) - printf("checkpath: .. not a directory\n"); + SDT_PROBE2(ext2fs, , lookup, trace, 1, + "checkpath: .. not a directory"); if (vp != NULL) vput(vp); return (error); Modified: head/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_subr.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_subr.c Tue Apr 16 11:20:10 2019 (r346267) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 16 11:20:10 2019 (r346267) @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -67,7 +68,17 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , vfsops, trace, "int", "char*"); +SDT_PROBE_DEFINE2(ext2fs, , vfsops, ext2_cg_validate_error, "char*", "int"); +SDT_PROBE_DEFINE1(ext2fs, , vfsops, ext2_compute_sb_data_error, "char*"); + static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); static int ext2_mountfs(struct vnode *, struct mount *); static int ext2_reload(struct mount *mp, struct thread *td); @@ -381,48 +392,54 @@ ext2_cg_validate(struct m_ext2fs *fs) b_bitmap = e2fs_gd_get_b_bitmap(gd); if (b_bitmap == 0) { - printf("ext2fs: cg %u: block bitmap is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap is zero", i); return (EINVAL); } if (b_bitmap <= last_cg_block) { - printf("ext2fs: cg %u: block bitmap overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap overlaps gds", i); return (EINVAL); } if (b_bitmap < first_block || b_bitmap > last_block) { - printf("ext2fs: cg %u: block bitmap not in group, blk=%ju\n", - i, b_bitmap); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap not in group", i); return (EINVAL); } i_bitmap = e2fs_gd_get_i_bitmap(gd); if (i_bitmap == 0) { - printf("ext2fs: cg %u: inode bitmap is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap is zero", i); return (EINVAL); } if (i_bitmap <= last_cg_block) { - printf("ext2fs: cg %u: inode bitmap overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap overlaps gds", i); return (EINVAL); } if (i_bitmap < first_block || i_bitmap > last_block) { - printf("ext2fs: cg %u: inode bitmap not in group blk=%ju\n", - i, i_bitmap); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap not in group blk", i); return (EINVAL); } i_tables = e2fs_gd_get_i_tables(gd); if (i_tables == 0) { - printf("ext2fs: cg %u: inode table is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode table is zero", i); return (EINVAL); } if (i_tables <= last_cg_block) { - printf("ext2fs: cg %u: inode talbes overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode talbes overlaps gds", i); return (EINVAL); } if (i_tables < first_block || i_tables + fs->e2fs_itpg - 1 > last_block) { - printf("ext2fs: cg %u: inode tables not in group blk=%ju\n", - i, i_tables); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode tables not in group blk", i); return (EINVAL); } @@ -450,7 +467,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check checksum features */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) && EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - printf("ext2fs: incorrect checksum features combination\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "incorrect checksum features combination"); return (EINVAL); } @@ -467,7 +485,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check for block size = 1K|2K|4K */ if (es->e2fs_log_bsize > 2) { - printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "bad block size"); return (EINVAL); } @@ -479,15 +498,15 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check for fragment size */ if (es->e2fs_log_fsize > (EXT2_MAX_FRAG_LOG_SIZE - EXT2_MIN_BLOCK_LOG_SIZE)) { - printf("ext2fs: invalid log cluster size: %u\n", - es->e2fs_log_fsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid log cluster size"); return (EINVAL); } fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; if (fs->e2fs_fsize != fs->e2fs_bsize) { - printf("ext2fs: fragment size (%u) != block size %u\n", - fs->e2fs_fsize, fs->e2fs_bsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "fragment size != block size"); return (EINVAL); } @@ -495,8 +514,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check reserved gdt blocks for future filesystem expansion */ if (es->e2fs_reserved_ngdb > (fs->e2fs_bsize / 4)) { - printf("ext2fs: number of reserved GDT blocks too large: %u\n", - es->e2fs_reserved_ngdb); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "number of reserved GDT blocks too large"); return (EINVAL); } @@ -509,8 +528,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f * Check first ino. */ if (es->e2fs_first_ino < EXT2_FIRSTINO) { - printf("ext2fs: invalid first ino: %u\n", - es->e2fs_first_ino); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid first ino"); return (EINVAL); } @@ -520,8 +539,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f if (EXT2_INODE_SIZE(fs) < E2FS_REV0_INODE_SIZE || EXT2_INODE_SIZE(fs) > fs->e2fs_bsize || (fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) { - printf("ext2fs: invalid inode size %u\n", - fs->e2fs_isize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid inode size"); return (EINVAL); } } @@ -529,33 +548,36 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check group descriptors */ if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && es->e3fs_desc_size != E2FS_64BIT_GD_SIZE) { - printf("ext2fs: unsupported 64bit descriptor size %u\n", - es->e3fs_desc_size); - return (EINVAL); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "unsupported 64bit descriptor size"); + return (EINVAL); } fs->e2fs_bpg = es->e2fs_bpg; fs->e2fs_fpg = es->e2fs_fpg; if (fs->e2fs_bpg == 0 || fs->e2fs_fpg == 0) { - printf("ext2fs: zero blocks/fragments per group\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "zero blocks/fragments per group"); return (EINVAL); } if (fs->e2fs_bpg != fs->e2fs_bsize * 8) { - printf("ext2fs: non-standard group size unsupported %d\n", - fs->e2fs_bpg); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "non-standard group size unsupported"); return (EINVAL); } fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); if (fs->e2fs_ipb == 0 || fs->e2fs_ipb > fs->e2fs_bsize / E2FS_REV0_INODE_SIZE) { - printf("ext2fs: bad inodes per block size\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "bad inodes per block size"); return (EINVAL); } fs->e2fs_ipg = es->e2fs_ipg; if (fs->e2fs_ipg < fs->e2fs_ipb || fs->e2fs_ipg > fs->e2fs_bsize * 8) { - printf("ext2fs: invalid inodes per group: %u\n", fs->e2fs_ipb); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid inodes per group"); return (EINVAL); } @@ -571,25 +593,29 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f } if (fs->e2fs_rbcount > fs->e2fs_bcount || fs->e2fs_fbcount > fs->e2fs_bcount) { - printf("ext2fs: invalid block count\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid block count"); return (EINVAL); } if (es->e2fs_first_dblock >= fs->e2fs_bcount) { - printf("ext2fs: first data block out of range\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "first data block out of range"); return (EINVAL); } fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock, EXT2_BLOCKS_PER_GROUP(fs)); if (fs->e2fs_gcount > ((uint64_t)1 << 32) - EXT2_DESCS_PER_BLOCK(fs)) { - printf("ext2fs: groups count too large: %u\n", fs->e2fs_gcount); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "groups count too large"); return (EINVAL); } /* Check for extra isize in big inodes. */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_EXTRA_ISIZE) && EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { - printf("ext2fs: no space for extra inode timestamps\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "no space for extra inode timestamps"); return (EINVAL); } @@ -1095,8 +1121,7 @@ ext2_sync(struct mount *mp, int waitfor) td = curthread; fs = ump->um_e2fs; if (fs->e2fs_fmod != 0 && fs->e2fs_ronly != 0) { /* XXX */ - printf("fs = %s\n", fs->e2fs_fsmnt); - panic("ext2_sync: rofs mod"); + panic("ext2_sync: rofs mod fs=%s", fs->e2fs_fsmnt); } /* @@ -1242,7 +1267,7 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, stru for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS ext2_print_inode(ip); ext4_ext_print_extent_tree_status(ip); #endif Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/ext2_vnops.c Tue Apr 16 11:20:10 2019 (r346267) @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , vnops, trace, "int", "char*"); + static int ext2_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static void ext2_itimes_locked(struct vnode *); @@ -813,7 +822,8 @@ abortit: * not call us in that case. Temporarily just warn if they do. */ if (fvp == tvp) { - printf("ext2_rename: fvp == tvp (can't happen)\n"); + SDT_PROBE2(ext2fs, , vnops, trace, 1, + "rename: fvp == tvp (can't happen)"); error = 0; goto abortit; } Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Tue Apr 16 09:44:46 2019 (r346266) +++ head/sys/fs/ext2fs/fs.h Tue Apr 16 11:20:10 2019 (r346267) @@ -164,6 +164,6 @@ /* * Use if additional debug logging is required. */ -/* #define EXT2FS_DEBUG */ +/* #define EXT2FS_PRINT_EXTENTS */ #endif /* !_FS_EXT2FS_FS_H_ */ From owner-svn-src-head@freebsd.org Tue Apr 16 11:37:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7682156F163; Tue, 16 Apr 2019 11:37:16 +0000 (UTC) (envelope-from fsu@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 8529A88825; Tue, 16 Apr 2019 11:37:16 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E9931F09D; Tue, 16 Apr 2019 11:37:16 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GBbGpc046583; Tue, 16 Apr 2019 11:37:16 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GBbG0m046582; Tue, 16 Apr 2019 11:37:16 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201904161137.x3GBbG0m046582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Tue, 16 Apr 2019 11:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346269 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 346269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8529A88825 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,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, 16 Apr 2019 11:37:17 -0000 Author: fsu Date: Tue Apr 16 11:37:15 2019 New Revision: 346269 URL: https://svnweb.freebsd.org/changeset/base/346269 Log: ext2fs: Initial version of DTrace support. Commit forgotten file. Reviewed by: pfg, gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19848 Modified: head/sys/fs/ext2fs/ext2_extents.c Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Tue Apr 16 11:30:41 2019 (r346268) +++ head/sys/fs/ext2fs/ext2_extents.c Tue Apr 16 11:37:15 2019 (r346269) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -46,9 +47,17 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, extents, "int", "char*"); + static MALLOC_DEFINE(M_EXT2EXTENTS, "ext2_extents", "EXT2 extents"); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS static void ext4_ext_print_extent(struct ext4_extent *ep) { @@ -230,22 +239,22 @@ ext4_ext_check_header(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (eh->eh_magic != EXT4_EXT_MAGIC) { - error_msg = "invalid magic"; + error_msg = "header: invalid magic"; goto corrupted; } if (eh->eh_max == 0) { - error_msg = "invalid eh_max"; + error_msg = "header: invalid eh_max"; goto corrupted; } if (eh->eh_ecount > eh->eh_max) { - error_msg = "invalid eh_entries"; + error_msg = "header: invalid eh_entries"; goto corrupted; } return (0); corrupted: - ext2_fserr(fs, ip->i_uid, error_msg); + SDT_PROBE2(ext2fs, , trace, extents, 1, error_msg); return (EIO); } @@ -412,7 +421,7 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, ppos++; if (ppos > depth) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ppos > depth => extent corrupted"); error = EIO; brelse(bp); @@ -643,13 +652,13 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (lblk == path->ep_index->ei_blk) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "lblk == index blk => extent corrupted"); return (EIO); } if (path->ep_header->eh_ecount >= path->ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ecout > maxcount => extent corrupted"); return (EIO); } @@ -667,7 +676,7 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex memmove(idx + 1, idx, len * sizeof(struct ext4_extent_index)); if (idx > EXT_MAX_INDEX(path->ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "index is out of range => extent corrupted"); return (EIO); } @@ -736,7 +745,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa * We will split at current extent for now. */ if (path[depth].ep_ext > EXT_MAX_EXTENT(path[depth].ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extent is out of range => extent corrupted"); return (EIO); } @@ -773,7 +782,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa ex = EXT_FIRST_EXTENT(neh); if (path[depth].ep_header->eh_ecount != path[depth].ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extents count out of range => extent corrupted"); error = EIO; goto cleanup; @@ -1362,7 +1371,7 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ eh = path[depth].ep_header; if (!eh) { - ext2_fserr(ip->i_e2fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "bad header => extent corrupted"); return (EIO); } @@ -1449,7 +1458,8 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_dad eh = ext4_ext_block_header(bp->b_data); if (eh->eh_depth != depth) { - ext2_fserr(fs, ip->i_uid, "unexpected eh_depth"); + SDT_PROBE2(ext2fs, , trace, extents, 1, + "unexpected eh_depth"); goto err; } From owner-svn-src-head@freebsd.org Tue Apr 16 12:25:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C4461570D07; Tue, 16 Apr 2019 12:25:16 +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 4013D8A181; Tue, 16 Apr 2019 12:25:16 +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 27D1A1F919; Tue, 16 Apr 2019 12:25:16 +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 x3GCPFPw072251; Tue, 16 Apr 2019 12:25:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GCPF5K072250; Tue, 16 Apr 2019 12:25:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201904161225.x3GCPF5K072250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 16 Apr 2019 12:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346270 - head/cddl/usr.sbin/zfsd X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/cddl/usr.sbin/zfsd X-SVN-Commit-Revision: 346270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4013D8A181 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,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, 16 Apr 2019 12:25:16 -0000 Author: trasz Date: Tue Apr 16 12:25:15 2019 New Revision: 346270 URL: https://svnweb.freebsd.org/changeset/base/346270 Log: Drop -g from CFLAGS for zfsd(8). No idea why it was ever there. Reviewed by: kib, ngie, asomers MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19915 Modified: head/cddl/usr.sbin/zfsd/Makefile.common Modified: head/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- head/cddl/usr.sbin/zfsd/Makefile.common Tue Apr 16 11:37:15 2019 (r346269) +++ head/cddl/usr.sbin/zfsd/Makefile.common Tue Apr 16 12:25:15 2019 (r346270) @@ -30,7 +30,7 @@ INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/ut INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs INCFLAGS+= -I${SRCTOP}/cddl/usr.sbin -CFLAGS+= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} +CFLAGS+= -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} LIBADD+= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil From owner-svn-src-head@freebsd.org Tue Apr 16 12:39:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7698E15710C0; Tue, 16 Apr 2019 12:39:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 170408A6F2; Tue, 16 Apr 2019 12:39:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 054C01FAD8; Tue, 16 Apr 2019 12:39:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GCdWHq077602; Tue, 16 Apr 2019 12:39:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GCdWt8077597; Tue, 16 Apr 2019 12:39:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904161239.x3GCdWt8077597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Apr 2019 12:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346271 - in head/sys/arm/allwinner: . clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm/allwinner: . clkng X-SVN-Commit-Revision: 346271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 170408A6F2 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)[-1.000,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, 16 Apr 2019 12:39:33 -0000 Author: manu Date: Tue Apr 16 12:39:31 2019 New Revision: 346271 URL: https://svnweb.freebsd.org/changeset/base/346271 Log: aw_rtc: Register the clocks Since latest DTS update the rtc is supposed to register two clocks : - osc32k (the 32k oscillator on the board that the RTC uses directly and that other peripheral can use) - iosc (the internal oscillator of the RTC when available which frequency depend on the SoC revision) Since we need the RTC before the proper clock control unit (because it uses those clocks) attach it a BUS_PASS_BUS + MIDDLE and attach the clock control unit at BUS_PASS_BUS + LAST for the SoC that requires it. Tested On: A20, H3, A64 MFC after: 1 month Modified: head/sys/arm/allwinner/aw_rtc.c head/sys/arm/allwinner/clkng/ccu_a31.c head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/arm/allwinner/clkng/ccu_a83t.c head/sys/arm/allwinner/clkng/ccu_h3.c Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Tue Apr 16 12:25:15 2019 (r346270) +++ head/sys/arm/allwinner/aw_rtc.c Tue Apr 16 12:39:31 2019 (r346271) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2019 Emmanuel Vadot * Copyright (c) 2016 Vladimir Belian * All rights reserved. * @@ -43,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include "clock_if.h" @@ -62,7 +65,7 @@ __FBSDID("$FreeBSD$"); #define LOSC_MAGIC 0x16aa0000 #define LOSC_BUSY_MASK 0x00000380 -#define IS_SUN7I (sc->type == A20_RTC) +#define IS_SUN7I (sc->conf->is_a20 == true) #define YEAR_MIN (IS_SUN7I ? 1970 : 2010) #define YEAR_MAX (IS_SUN7I ? 2100 : 2073) @@ -92,27 +95,68 @@ __FBSDID("$FreeBSD$"); #define RTC_READ(sc, reg) bus_read_4((sc)->res, (reg)) #define RTC_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) -#define IS_LEAP_YEAR(y) \ - (((y) % 400) == 0 || (((y) % 100) != 0 && ((y) % 4) == 0)) +#define IS_LEAP_YEAR(y) (((y) % 400) == 0 || (((y) % 100) != 0 && ((y) % 4) == 0)) -#define A10_RTC 1 -#define A20_RTC 2 -#define A31_RTC 3 +struct aw_rtc_conf { + uint64_t iosc_freq; + bus_size_t rtc_date; + bus_size_t rtc_time; + bus_size_t rtc_losc_sta; + bool is_a20; +}; +struct aw_rtc_conf a10_conf = { + .rtc_date = A10_RTC_DATE_REG, + .rtc_time = A10_RTC_TIME_REG, + .rtc_losc_sta = LOSC_CTRL_REG, +}; + +struct aw_rtc_conf a20_conf = { + .rtc_date = A10_RTC_DATE_REG, + .rtc_time = A10_RTC_TIME_REG, + .rtc_losc_sta = LOSC_CTRL_REG, + .is_a20 = true, +}; + +struct aw_rtc_conf a31_conf = { + .iosc_freq = 650000, /* between 600 and 700 Khz */ + .rtc_date = A31_RTC_DATE_REG, + .rtc_time = A31_RTC_TIME_REG, + .rtc_losc_sta = A31_LOSC_AUTO_SWT_STA, +}; + +struct aw_rtc_conf h3_conf = { + .iosc_freq = 16000000, + .rtc_date = A31_RTC_DATE_REG, + .rtc_time = A31_RTC_TIME_REG, + .rtc_losc_sta = A31_LOSC_AUTO_SWT_STA, +}; + static struct ofw_compat_data compat_data[] = { - { "allwinner,sun4i-a10-rtc", A10_RTC }, - { "allwinner,sun7i-a20-rtc", A20_RTC }, - { "allwinner,sun6i-a31-rtc", A31_RTC }, + { "allwinner,sun4i-a10-rtc", (uintptr_t) &a10_conf }, + { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, + { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, + { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } }; struct aw_rtc_softc { struct resource *res; + struct aw_rtc_conf *conf; int type; - bus_size_t rtc_date; - bus_size_t rtc_time; }; +static struct clk_fixed_def aw_rtc_osc32k = { + .clkdef.id = 0, + .freq = 32768, +}; + +static struct clk_fixed_def aw_rtc_iosc = { + .clkdef.id = 2, +}; + +static void aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev); + static int aw_rtc_probe(device_t dev); static int aw_rtc_attach(device_t dev); static int aw_rtc_detach(device_t dev); @@ -140,9 +184,8 @@ static driver_t aw_rtc_driver = { static devclass_t aw_rtc_devclass; EARLY_DRIVER_MODULE(aw_rtc, simplebus, aw_rtc_driver, aw_rtc_devclass, 0, 0, - BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); - static int aw_rtc_probe(device_t dev) { @@ -161,7 +204,6 @@ static int aw_rtc_attach(device_t dev) { struct aw_rtc_softc *sc = device_get_softc(dev); - bus_size_t rtc_losc_sta; uint32_t val; int rid = 0; @@ -171,20 +213,7 @@ aw_rtc_attach(device_t dev) return (ENXIO); } - sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - switch (sc->type) { - case A10_RTC: - case A20_RTC: - sc->rtc_date = A10_RTC_DATE_REG; - sc->rtc_time = A10_RTC_TIME_REG; - rtc_losc_sta = LOSC_CTRL_REG; - break; - case A31_RTC: - sc->rtc_date = A31_RTC_DATE_REG; - sc->rtc_time = A31_RTC_TIME_REG; - rtc_losc_sta = A31_LOSC_AUTO_SWT_STA; - break; - } + sc->conf = (struct aw_rtc_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; val = RTC_READ(sc, LOSC_CTRL_REG); val |= LOSC_AUTO_SW_EN; val |= LOSC_MAGIC | LOSC_GSM | LOSC_OSC_SRC; @@ -193,13 +222,15 @@ aw_rtc_attach(device_t dev) DELAY(100); if (bootverbose) { - val = RTC_READ(sc, rtc_losc_sta); + val = RTC_READ(sc, sc->conf->rtc_losc_sta); if ((val & LOSC_OSC_SRC) == 0) device_printf(dev, "Using internal oscillator\n"); else device_printf(dev, "Using external oscillator\n"); } + aw_rtc_install_clocks(sc, dev); + clock_register(dev, RTC_RES_US); return (0); @@ -212,6 +243,41 @@ aw_rtc_detach(device_t dev) return (EBUSY); } +static void +aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev) { + struct clkdom *clkdom; + const char **clknames; + phandle_t node; + int nclocks; + + node = ofw_bus_get_node(dev); + nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames); + /* No clocks to export */ + if (nclocks <= 0) + return; + + if (nclocks != 3) { + device_printf(dev, "Having only %d clocks instead of 3, aborting\n", nclocks); + return; + } + + clkdom = clkdom_create(dev); + + aw_rtc_osc32k.clkdef.name = clknames[0]; + if (clknode_fixed_register(clkdom, &aw_rtc_osc32k) != 0) + device_printf(dev, "Cannot register osc32k clock\n"); + + aw_rtc_iosc.clkdef.name = clknames[2]; + aw_rtc_iosc.freq = sc->conf->iosc_freq; + if (clknode_fixed_register(clkdom, &aw_rtc_iosc) != 0) + device_printf(dev, "Cannot register iosc clock\n"); + + clkdom_finit(clkdom); + + if (bootverbose) + clkdom_dump(clkdom); +} + static int aw_rtc_gettime(device_t dev, struct timespec *ts) { @@ -219,11 +285,11 @@ aw_rtc_gettime(device_t dev, struct timespec *ts) struct clocktime ct; uint32_t rdate, rtime; - rdate = RTC_READ(sc, sc->rtc_date); - rtime = RTC_READ(sc, sc->rtc_time); + rdate = RTC_READ(sc, sc->conf->rtc_date); + rtime = RTC_READ(sc, sc->conf->rtc_time); if ((rtime & TIME_MASK) == 0) - rdate = RTC_READ(sc, sc->rtc_date); + rdate = RTC_READ(sc, sc->conf->rtc_date); ct.sec = GET_SEC_VALUE(rtime); ct.min = GET_MIN_VALUE(rtime); @@ -265,7 +331,7 @@ aw_rtc_settime(device_t dev, struct timespec *ts) DELAY(1); } /* reset time register to avoid unexpected date increment */ - RTC_WRITE(sc, sc->rtc_time, 0); + RTC_WRITE(sc, sc->conf->rtc_time, 0); rdate = SET_DAY_VALUE(ct.day) | SET_MON_VALUE(ct.mon) | SET_YEAR_VALUE(ct.year - YEAR_OFFSET) | @@ -281,7 +347,7 @@ aw_rtc_settime(device_t dev, struct timespec *ts) } DELAY(1); } - RTC_WRITE(sc, sc->rtc_date, rdate); + RTC_WRITE(sc, sc->conf->rtc_date, rdate); for (clk = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; clk++) { if (clk > RTC_TIMEOUT) { @@ -290,7 +356,7 @@ aw_rtc_settime(device_t dev, struct timespec *ts) } DELAY(1); } - RTC_WRITE(sc, sc->rtc_time, rtime); + RTC_WRITE(sc, sc->conf->rtc_time, rtime); DELAY(RTC_TIMEOUT); Modified: head/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a31.c Tue Apr 16 12:25:15 2019 (r346270) +++ head/sys/arm/allwinner/clkng/ccu_a31.c Tue Apr 16 12:39:31 2019 (r346271) @@ -973,4 +973,4 @@ DEFINE_CLASS_1(ccu_a31ng, ccu_a31ng_driver, ccu_a31ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a31ng, simplebus, ccu_a31ng_driver, - ccu_a31ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a31ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Tue Apr 16 12:25:15 2019 (r346270) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Tue Apr 16 12:39:31 2019 (r346271) @@ -825,4 +825,4 @@ DEFINE_CLASS_1(ccu_a64ng, ccu_a64ng_driver, ccu_a64ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a64ng, simplebus, ccu_a64ng_driver, - ccu_a64ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a64ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: head/sys/arm/allwinner/clkng/ccu_a83t.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a83t.c Tue Apr 16 12:25:15 2019 (r346270) +++ head/sys/arm/allwinner/clkng/ccu_a83t.c Tue Apr 16 12:39:31 2019 (r346271) @@ -786,4 +786,4 @@ DEFINE_CLASS_1(ccu_a83tng, ccu_a83tng_driver, ccu_a83t sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a83tng, simplebus, ccu_a83tng_driver, - ccu_a83tng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a83tng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: head/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h3.c Tue Apr 16 12:25:15 2019 (r346270) +++ head/sys/arm/allwinner/clkng/ccu_h3.c Tue Apr 16 12:39:31 2019 (r346271) @@ -787,4 +787,4 @@ DEFINE_CLASS_1(ccu_h3ng, ccu_h3ng_driver, ccu_h3ng_met sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_h3ng, simplebus, ccu_h3ng_driver, - ccu_h3ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_h3ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); From owner-svn-src-head@freebsd.org Tue Apr 16 12:40:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B98D1571165; Tue, 16 Apr 2019 12:40:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 1152E8A87D; Tue, 16 Apr 2019 12:40:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEF4C1FBF7; Tue, 16 Apr 2019 12:40:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GCenc6078530; Tue, 16 Apr 2019 12:40:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GCenJW078529; Tue, 16 Apr 2019 12:40:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904161240.x3GCenJW078529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Apr 2019 12:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346272 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 346272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1152E8A87D 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.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 12:40:50 -0000 Author: manu Date: Tue Apr 16 12:40:49 2019 New Revision: 346272 URL: https://svnweb.freebsd.org/changeset/base/346272 Log: aw_syscon: Add a new compatible Since 5.0 DTS the syscon controller have a new compatible as it exports new subnodes, we currently only use it as a syscon provider so just add the new compatible. Tested On: H3 MFC after: 1 month Modified: head/sys/arm/allwinner/aw_syscon.c Modified: head/sys/arm/allwinner/aw_syscon.c ============================================================================== --- head/sys/arm/allwinner/aw_syscon.c Tue Apr 16 12:39:31 2019 (r346271) +++ head/sys/arm/allwinner/aw_syscon.c Tue Apr 16 12:40:49 2019 (r346272) @@ -52,6 +52,7 @@ static struct ofw_compat_data compat_data[] = { {"allwinner,sun50i-a64-system-control", 1}, {"allwinner,sun8i-a83t-system-controller", 1}, {"allwinner,sun8i-h3-system-controller", 1}, + {"allwinner,sun8i-h3-system-control", 1}, {NULL, 0} }; From owner-svn-src-head@freebsd.org Tue Apr 16 13:04:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 010CC1571990; Tue, 16 Apr 2019 13:04:02 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A6358B4C0; Tue, 16 Apr 2019 13:04:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 882c15f1; Tue, 16 Apr 2019 15:03:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=7sI2AOBH9ed9QNhUI2VOlsiqxFg=; b=f6ec3m66Tef3wnb7NUT0xGCkw/Pi HDptPdgIwdNmQqBKKdOBVd1y3MAIwdWqte2YPbof2qVqpNo+kcU3pwpoTJNwMGig 4JmFWhpyRsm3Ghs7hCvLlEpu7BhaAZ5XqKWYq0xi5g3hXvawDHpK12c9yde6c1z3 a6lKT813OYGBF70= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=SNjoxD5IGpg2L9xwaa0N8eZHx3k/CSNylln6tN0kWNHvnppDlEpAL3EG f7b2kgbyK5v5W/lodnpgy89CkrV4V4l3yVkuF6gqvGARvEWyoKgARRq9qwvX/uin BoqeXmvCgmuqIjmRtNWDi1SnqT/jxclXeN6uSXMOBglS99kITOw= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 55086c1a TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Tue, 16 Apr 2019 15:03:53 +0200 (CEST) Date: Tue, 16 Apr 2019 15:03:52 +0200 From: Emmanuel Vadot To: cem@freebsd.org Cc: Justin Hibbits , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys Message-Id: <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> In-Reply-To: References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0A6358B4C0 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.954,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, 16 Apr 2019 13:04:02 -0000 On Mon, 15 Apr 2019 17:54:56 -0700 Conrad Meyer wrote: > On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer wrote: > > E.g., the CI infrastructure for > > Riscv/Arm is/was generating minimal filesystem images and not > > populating /boot/entropy. > > I should add, I say "is/was" because I have a PR out which may address > the problem: https://github.com/freebsd/freebsd-ci/pull/31 > > Best, > Conrad It's not only CI, all release images (memstick, iso) don't have a /boot/entropy. Also all arm/arm64 image don't have this file too. If /boot/entropy is needed and isn't present loader(8) should gather some entropy and pass this to the kernel for the first boot. -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Tue Apr 16 13:19:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 119F11571DB6 for ; Tue, 16 Apr 2019 13:19:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE128BAE0 for ; Tue, 16 Apr 2019 13:18:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x832.google.com with SMTP id d13so23195108qth.5 for ; Tue, 16 Apr 2019 06:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YYTVFVHGP1B8pLhMF/hQocYKm5q5B5l1WgRuLhJMQ8g=; b=N7MzRjF0KKpYM+9V2jx7TFaFza4vPwKi7f5vpV8MGuUBZ1z1xaHCFwiUPkC0Ssx1gy vyS5BNOWpaBXKl+/+o4+dNoc5BFQDargvhOHMlhR6HcWUw8eaPrwcjcgvVDfekFT5hs3 bq8v8aTKxhKWPgDOf7DrQWrgmqO+6z92NwoZbrhpJrLYBQfe7Cp9nR8/M2BW2KyWOoBZ +FMbnnBE6OLHeH2S4poBpqgw7hNv5oNfM8DP9VpswmRugnA5DTPWBVMrwTtPJ2RzU2oZ UwN2F55rB5Tql5HhpTPkkxwj9IRVbRngZsR3dSvt86rmCvmg3rZ5LiLRQTeP64FBzOJi OuPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YYTVFVHGP1B8pLhMF/hQocYKm5q5B5l1WgRuLhJMQ8g=; b=d14K5AJqsc6v5zfUh1V6qF0OVWx8rMgnGt7sMCPDEgOBxnUCSMCZLISHA9//PBhvcD 4CS3zla06UqVdVL1U95pNSxAKoQfNQe0vi4645DhetA0U7tw0nyPM7nVu72oaHHAuiQy iDyxfKO6mwcqAQ9yVAj7fIQRFa2swQpLjoKJkjfBO2oCpYEI0ZaJRq018ANuvel4mvI+ l63NFjer14IlAo6bf+9V0VUQN+28Wf7sujxlnGRCEIv7UwbFSASJSk56z0HBG4tO1hBl JNN/3g3885MEKjVx+i9YbGd7WIYfI2ekh/NXz7RbuychoAOGEK3+UZ82g7FsAfpBYr2K yBTg== X-Gm-Message-State: APjAAAWeBhmqNqQuW4zFfiP9+KDsoX8rGBenPLUaj2uEvr9MCM7ZJZiq urUPJdGI4NwSnSq8jt5jRaPop415eOJG/CN6MS+bwg== X-Google-Smtp-Source: APXvYqy2R6ruSXPPye4t9gDmY4d8Ecn4uTjx9G7WW1JpKb/BPkxt7+j8Qb55gUdmoE/7UwMZPlzOcSJmbGOr/ZgDStw= X-Received: by 2002:ac8:5493:: with SMTP id h19mr50937101qtq.23.1555420738542; Tue, 16 Apr 2019 06:18:58 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> In-Reply-To: <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> From: Warner Losh Date: Tue, 16 Apr 2019 07:18:46 -0600 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Emmanuel Vadot Cc: "Conrad E. Meyer" , Justin Hibbits , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4EE128BAE0 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.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Tue, 16 Apr 2019 13:19:00 -0000 On Tue, Apr 16, 2019, 7:04 AM Emmanuel Vadot wrote: > On Mon, 15 Apr 2019 17:54:56 -0700 > Conrad Meyer wrote: > > > On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer wrote: > > > E.g., the CI infrastructure for > > > Riscv/Arm is/was generating minimal filesystem images and not > > > populating /boot/entropy. > > > > I should add, I say "is/was" because I have a PR out which may address > > the problem: https://github.com/freebsd/freebsd-ci/pull/31 > > > > Best, > > Conrad > > It's not only CI, all release images (memstick, iso) don't have > a /boot/entropy. > Also all arm/arm64 image don't have this file too. > If /boot/entropy is needed and isn't present loader(8) should gather > some entropy and pass this to the kernel for the first boot. > Maybe we need to bootstrap the entropy file as part of buildworld. I'm not sure if the loader can find enough... Warner -- > Emmanuel Vadot > > From owner-svn-src-head@freebsd.org Tue Apr 16 13:20:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F301571F07 for ; Tue, 16 Apr 2019 13:20:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 505278BC94 for ; Tue, 16 Apr 2019 13:20:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x830.google.com with SMTP id v20so23147269qtv.12 for ; Tue, 16 Apr 2019 06:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7/HKjswzcI5RPNxTg/hAVI6NF3iPXMKNwF2/ITgGCj8=; b=e1+veL3HkNBpinLVZl+QSHd4j4JiY1ci/JXzgbHjzyunpQpznJPkP2lXMm+Pe11URC HXgZNdq3iKFuruhbO/Q0TUNZe1ElRpQIPRR4dfLDDzvswQxiA5+3fxckSXsbzhbmGZmS fOQsnCEjPxxNvCtQ0g7xDuA0uqTH3E5nIm1Wt4zRqEhplRKlkdXJER0sCebkvC/lb6EX vfF/aRxFyJZpTbGFM3X6CnBmDpUmsHAuEeaejBoN7cNVOhNoV5Xz+77XiGR5UhFX3+zU 9h++/d96AvB8R0leruHZkvapFvUdwhWPhdRpLsJGQtSctobV3ZrP38mKIud/nkRBA/x4 +4Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7/HKjswzcI5RPNxTg/hAVI6NF3iPXMKNwF2/ITgGCj8=; b=lWPuK6UcTyIKvRgkh0b7KZsB3Q5HDFCW8AMKrOqcZvQ47YXxAYWbvEKfhJ0n3lR2oS U55Bj41yvby6B0ITkPP2e3elVwthOkNrzPMBZN9HuQ49+h4342L9urGTkKoem0Y4Kh83 p4vLE6Ts50XzT7xuvvg9JoV4qKT3FuVDcrZl8L/p8faWgIDVyHeV3yb9o8G/92abT2XN VQKiTqWBmkhfmk2yCGmgOEwz0G29hjQQnDy9hpluoT7b8u6eW/8EX1W2S4GnAImlcYZJ NiXYS070rIiQExi9gN/TqTA1OtkmtSTPTog68tGlwKHG0jNpT08OWkE9DAInR8vJBaQ/ qcuw== X-Gm-Message-State: APjAAAXN8WEZt4dF8pQTpnV3/fuQgB2Kb6mum+Kvss+cZRZAQZYDoSea 8xmj1dJoQZlg+aHh9n8R+pPlgg== X-Google-Smtp-Source: APXvYqx18N+YnmkU0qNoZ35oSmQD9+dGKq36lZH0tj64bZFQZiQ8OIqwxvCf3hfaaFOOfl/2yIi1Hg== X-Received: by 2002:ac8:33dd:: with SMTP id d29mr65183528qtb.320.1555420821685; Tue, 16 Apr 2019 06:20:21 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id q51sm35502302qtc.38.2019.04.16.06.20.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 06:20:20 -0700 (PDT) Date: Tue, 16 Apr 2019 09:19:15 -0400 From: Shawn Webb To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346263 - head/contrib/tcpdump Message-ID: <20190416131915.2ocot4nonnf3sl4a@mutt-hbsd> References: <201904160412.x3G4CgN2015092@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="epj5rmk7yofcyaoj" Content-Disposition: inline In-Reply-To: <201904160412.x3G4CgN2015092@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 505278BC94 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.988,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: Tue, 16 Apr 2019 13:20:23 -0000 --epj5rmk7yofcyaoj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 16, 2019 at 04:12:42AM +0000, Mariusz Zaborski wrote: > Author: oshogbo > Date: Tue Apr 16 04:12:41 2019 > New Revision: 346263 > URL: https://svnweb.freebsd.org/changeset/base/346263 >=20 > Log: > tcpdump: disable Capsicum if -E option is provided. > =20 > The -E is used to provide a secret for decrypting IPsec. > The secret may be provided through command line or as the file. > The problem is that tcpdump doesn't support yet opening files in capabi= lity mode > and the file may contain a list of the files to open. > =20 > As a workaround, for now, let's just disable capsicum if the -E > the option is provided. > =20 > PR: 236819 > MFC after: 2 weeks >=20 > Modified: > head/contrib/tcpdump/tcpdump.c >=20 > Modified: head/contrib/tcpdump/tcpdump.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/contrib/tcpdump/tcpdump.c Tue Apr 16 02:48:04 2019 (r346262) > +++ head/contrib/tcpdump/tcpdump.c Tue Apr 16 04:12:41 2019 (r346263) > @@ -2063,7 +2063,8 @@ main(int argc, char **argv) > } > =20 > #ifdef HAVE_CAPSICUM > - cansandbox =3D (VFileName =3D=3D NULL && zflag =3D=3D NULL); > + cansandbox =3D (VFileName =3D=3D NULL && zflag =3D=3D NULL && > + ndo->ndo_espsecret =3D=3D NULL); > #ifdef HAVE_CASPER > cansandbox =3D (cansandbox && (ndo->ndo_nflag || capdns !=3D NULL)); > #else Is there any documentation anywhere telling users that Capsicum support will be disabled under certain circumstances? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --epj5rmk7yofcyaoj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAly11k0ACgkQ/y5nonf4 4fowyBAAosXBRr/wadcuilGpEb9c6ytfp+mBiubhDc2s3cNgth5yEIY9RxZBU1SS cshIWcTPdmyb063/0HLroBaqJZmnw3Rro+esu+Oirh+0rj3W1GSxqHE4yohr2iux Q1i8/C4wUVI7hvUHvs44/NqOxPhnOr34KL+YgQ6T8R7H1HVD+Jfh9Zo/apkUKBVC 5WorHPu9u9sxAyIQ16PZvS9TzbD/u4LzYSGABa78whk9IUU/MG9LBIC+kjwV9nBv ZpWrdfqIJsOzeY3BM8XYWqBXQdXCR0xQVrQm2h5Kx+9qB+93ptxx8TI2bi3CCZUd qtbjjvk0bHH6rIJWBNG+3qzt1ouGF9utHIHYkmb8RyUPKRx6UB8MBbV+a5C1Txry MSG7wwtcYz/73c4RAY5whI7DfHi/2sd1nbOfJcVcH3TObZQRMvr9PGE320RFMmK8 SpfBp7PkTjiSlwli6Ci6nqjg6mFcvFM24UvoJ/4aDjp0HNfAyWFEqr5kEtALBC4V WZFCLpNwwlhO0XTZBhJXqpDPRDO94z01cQVkv5OAPZNLm9SUSZnAHmHLyUs68yhI LzbRV1swUi80sI/7hC+YVT09tmbcFm3TVOqVvhXxBVcqUrY3J3+fufVRctTXFYWf HlCSfoG/l6RXmo1OYanEIW3DSSVYXcBgmjV6eZk0FL2cwyrdErA= =edr2 -----END PGP SIGNATURE----- --epj5rmk7yofcyaoj-- From owner-svn-src-head@freebsd.org Tue Apr 16 13:26:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9641615722CD; Tue, 16 Apr 2019 13:26:32 +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 38DF88C1B0; Tue, 16 Apr 2019 13:26:32 +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 2592F20344; Tue, 16 Apr 2019 13:26:32 +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 x3GDQVsT003309; Tue, 16 Apr 2019 13:26:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GDQV9J003308; Tue, 16 Apr 2019 13:26:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904161326.x3GDQV9J003308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 16 Apr 2019 13:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346273 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 346273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38DF88C1B0 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.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 13:26:32 -0000 Author: emaste Date: Tue Apr 16 13:26:31 2019 New Revision: 346273 URL: https://svnweb.freebsd.org/changeset/base/346273 Log: correct readlinkat(2) return type r176215 corrected readlink(2)'s return type and the type of the last argument. readlink(2) was introduced in r177788 after being developed as part of Google Summer of Code 2007; it appears to have inherited the wrong return type. Man pages and header files were already ssize_t; update syscalls.master to match. PR: 197915 Submitted by: Henning Petersen MFC after: 2 weeks Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Tue Apr 16 12:40:49 2019 (r346272) +++ head/sys/compat/freebsd32/syscalls.master Tue Apr 16 13:26:31 2019 (r346273) @@ -963,7 +963,7 @@ uint32_t dev); } 499 AUE_OPENAT_RWTC NOPROTO { int openat(int fd, const char *path, \ int flag, mode_t mode); } -500 AUE_READLINKAT NOPROTO { int readlinkat(int fd, const char *path, \ +500 AUE_READLINKAT NOPROTO { ssize_t readlinkat(int fd, const char *path, \ char *buf, size_t bufsize); } 501 AUE_RENAMEAT NOPROTO { int renameat(int oldfd, const char *old, \ int newfd, const char *new); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue Apr 16 12:40:49 2019 (r346272) +++ head/sys/kern/syscalls.master Tue Apr 16 13:26:31 2019 (r346273) @@ -2716,7 +2716,7 @@ ); } 500 AUE_READLINKAT STD { - int readlinkat( + ssize_t readlinkat( int fd, _In_z_ const char *path, _Out_writes_bytes_(bufsize) char *buf, From owner-svn-src-head@freebsd.org Tue Apr 16 13:31:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA17F15726A3; Tue, 16 Apr 2019 13:31:17 +0000 (UTC) (envelope-from thj@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 736BB8C58B; Tue, 16 Apr 2019 13:31:17 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A6212038A; Tue, 16 Apr 2019 13:31:17 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GDVHxc006939; Tue, 16 Apr 2019 13:31:17 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GDVHbK006938; Tue, 16 Apr 2019 13:31:17 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201904161331.x3GDVHbK006938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Tue, 16 Apr 2019 13:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346274 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 736BB8C58B 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,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, 16 Apr 2019 13:31:17 -0000 Author: thj Date: Tue Apr 16 13:31:16 2019 New Revision: 346274 URL: https://svnweb.freebsd.org/changeset/base/346274 Log: Update and clarify pflog man page The pflog0 interface is created when the module is loaded, this can be triggered by pf and pflogd being enabled or by kldloading the module. By default the interface would be pflog0, add the ifconfig stage of the example to make this example clearer. Reviewed by: kp, bz, bcr, jtl, 0mp Approved by: jtl (mentor), bz (mentor) Differential Revision: https://reviews.freebsd.org/D19861 Modified: head/share/man/man4/pflog.4 Modified: head/share/man/man4/pflog.4 ============================================================================== --- head/share/man/man4/pflog.4 Tue Apr 16 13:26:31 2019 (r346273) +++ head/share/man/man4/pflog.4 Tue Apr 16 13:31:16 2019 (r346274) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2007 +.Dd April 9, 2019 .Dt PFLOG 4 .Os .Sh NAME @@ -47,13 +47,18 @@ on the interface, or stored to disk using .Xr pflogd 8 . .Pp -The pflog0 interface is created automatically at boot if both +The pflog0 interface is created when the +.Nm +module is loaded; +further instances can be created using +.Xr ifconfig 8 . +The +.Nm +module is loaded automatically if both .Xr pf 4 and .Xr pflogd 8 -are enabled; -further instances can be created using -.Xr ifconfig 8 . +are enabled. .Pp Each packet retrieved on this interface has a header associated with it of length @@ -87,6 +92,8 @@ Create a interface and monitor all packets logged on it: .Bd -literal -offset indent +# ifconfig pflog create +pflog1 # ifconfig pflog1 up # tcpdump -n -e -ttt -i pflog1 .Ed From owner-svn-src-head@freebsd.org Tue Apr 16 14:07:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1A2C15733F3; Tue, 16 Apr 2019 14:07:15 +0000 (UTC) (envelope-from gjb@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 539E88D6F1; Tue, 16 Apr 2019 14:07:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43D8220A01; Tue, 16 Apr 2019 14:07:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GE7FhD024297; Tue, 16 Apr 2019 14:07:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GE7F9N024296; Tue, 16 Apr 2019 14:07:15 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201904161407.x3GE7F9N024296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Apr 2019 14:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346275 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.sbin/portsnap/portsnap X-SVN-Commit-Revision: 346275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 539E88D6F1 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,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, 16 Apr 2019 14:07:15 -0000 Author: gjb Date: Tue Apr 16 14:07:14 2019 New Revision: 346275 URL: https://svnweb.freebsd.org/changeset/base/346275 Log: Remove INDEX-10 reference, as 10.x is now EoL. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/portsnap/portsnap/portsnap.conf Modified: head/usr.sbin/portsnap/portsnap/portsnap.conf ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.conf Tue Apr 16 13:31:16 2019 (r346274) +++ head/usr.sbin/portsnap/portsnap/portsnap.conf Tue Apr 16 14:07:14 2019 (r346275) @@ -30,7 +30,6 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3 # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -#INDEX INDEX-10 DESCRIBE.10 #INDEX INDEX-11 DESCRIBE.11 #INDEX INDEX-12 DESCRIBE.12 INDEX INDEX-13 DESCRIBE.13 From owner-svn-src-head@freebsd.org Tue Apr 16 14:24:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D77A1573B85; Tue, 16 Apr 2019 14:24:08 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it1-x133.google.com (mail-it1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9028F8E190; Tue, 16 Apr 2019 14:24:07 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it1-x133.google.com with SMTP id 139so32769387ita.4; Tue, 16 Apr 2019 07:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UIGAeRLdsge4kEwVaDCVfmNGLXdC0M0ryWRahl6VSIw=; b=kIkYUFxrSZNdLhQududHgRN369JhELrXCYqwC+M5Fe2A9hHcYs4vz3ME08meRQgsuM GkPv1IOQMYOIhF+3RLrPQZBANDy/ve+Cbu+WF7ZCQpV1UXR3WUIJZA0Gx7HXEs9mqOlf YYjm0BtoyJp6aeRRtR/dTFq8MWnv3Lsbq17BcOjsuJKqp4ozJhoIHhl1HGXUFviV8n5r +P1VqZ9A6El2DOojtK5UeE+OOx5aCRNq6AvO4THEGU73SnSa8zEGDOqEB8/oRHuVBTvS HeoVe+x8DJYdxFx38s1NAB9z1PSd0/4VUku+SWAGD3kcPsnEciICyZ21BXlgz/fsYXg7 cHZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UIGAeRLdsge4kEwVaDCVfmNGLXdC0M0ryWRahl6VSIw=; b=NGmaAp/b5PLIipyw/DS17hvxTboAp0k8S8M+ONtOA4iXdAHFtGLeTYqcuOtSpxdcKD cggmmMzZhCtrigw7ds1bg8u9G2Njy3njEu846q+PpMRFM6mEpfZc1qACk7qxLLl4Ucbw GmmDpUUSipVLWZisVKsdoV8y/kgfy84YKTvkWt0ltAmP95voFlVxP2WjZFi7AkJ5UmSv aINoQfG8HsVAm4Kv4DHpC8uyqoWQjTlAeI9BCFJQnQTOGcqjcqBbwf2v3uEvZDii75O6 LFO3lahR3nP3iPvbuZC186BzUUTRKWgRwz8d7PZlEsjrTLEPGKyfWxygWbmF/klM71q4 6yhw== X-Gm-Message-State: APjAAAXQxgCPVkq4oB79EG7veG/hBCWZ5WPyPwsGOdsD4ELLHFObaJvX CUKwvvbbbQa1vcowhsAA+XtePfVJ/kQ= X-Google-Smtp-Source: APXvYqxLYPz4lWLE/s0+Zb4jfKx7lknfY8n6Tg25/HphNFVRrynX9r/haMBaP128Oo5qKyQhC/XxxQ== X-Received: by 2002:a02:a892:: with SMTP id l18mr15190694jam.28.1555424646371; Tue, 16 Apr 2019 07:24:06 -0700 (PDT) Received: from titan.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id k11sm9388650itk.25.2019.04.16.07.24.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 07:24:06 -0700 (PDT) Date: Tue, 16 Apr 2019 09:24:02 -0500 From: Justin Hibbits To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys Message-ID: <20190416092402.4288bc90@titan.knownspace> In-Reply-To: References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9028F8E190 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.979,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: Tue, 16 Apr 2019 14:24:08 -0000 Hi Conrad, On Mon, 15 Apr 2019 17:53:17 -0700 Conrad Meyer wrote: > Hi Justin, > > On Mon, Apr 15, 2019 at 5:01 PM Justin Hibbits > wrote: > > Given the discussion over there it would probably also fail on > > powernv, which also does not use loader. > > Does power use bsdinstall (which populates /boot/entropy at install > time via usr.sbin/bsdinstall/scripts/entropy) and install the > libexec/rc/rc.d/random rc script (which re-emits new /boot/entropy on > every startup)? If so, it should be ok. > > The problem is new installs that don't use bsdinstall or otherwise > provide initial /boot/entropy. E.g., the CI infrastructure for > Riscv/Arm is/was generating minimal filesystem images and not > populating /boot/entropy. > > Best, > Conrad It does use bsdinstall to install. How is entropy loaded at startup, which causes the problem noted in github? If it's loaded before filesystems get mounted, that could be a problem for us, because /boot is on a different filesystem (msdosfs, to be read by petitboot). Petitboot also does not have a way to preload modules, so all we have at startup, until spawning init, is the kernel. - Justin From owner-svn-src-head@freebsd.org Tue Apr 16 14:28:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D213D1573DC6; Tue, 16 Apr 2019 14:28:34 +0000 (UTC) (envelope-from bde@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 746FC8E54A; Tue, 16 Apr 2019 14:28:34 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50AD320D7F; Tue, 16 Apr 2019 14:28:34 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GESYnN035248; Tue, 16 Apr 2019 14:28:34 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GESYT0035247; Tue, 16 Apr 2019 14:28:34 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904161428.x3GESYT0035247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 16 Apr 2019 14:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346276 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 746FC8E54A 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)[-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: Tue, 16 Apr 2019 14:28:35 -0000 Author: bde Date: Tue Apr 16 14:28:33 2019 New Revision: 346276 URL: https://svnweb.freebsd.org/changeset/base/346276 Log: Fix a variable name in r346215. Clearing of the right of the screen was broken, except it worked accidentally in most cases where the virtual screen is larger than the physical screen. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Tue Apr 16 14:07:14 2019 (r346275) +++ head/lib/libvgl/simple.c Tue Apr 16 14:28:33 2019 (r346276) @@ -515,7 +515,7 @@ VGLClear(VGLBitmap *object, u_long color) for (i = 0; i < object->VXsize; i++) bcopy(&color, src.Bitmap + i * object->PixelBytes, object->PixelBytes); for (i = 0; i < object->VYsize; i++) - __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VYsize, 1); + __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VXsize, 1); break; case VIDBUF8X: From owner-svn-src-head@freebsd.org Tue Apr 16 14:40:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C134B1574296; Tue, 16 Apr 2019 14:40:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::608]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBEE98EC5A; Tue, 16 Apr 2019 14:40:57 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback13o.mail.yandex.net (mxback13o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::64]) by forward105o.mail.yandex.net (Yandex) with ESMTP id CE0B74200C29; Tue, 16 Apr 2019 17:40:44 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback13o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DcOlWtERgz-eixe7TNJ; Tue, 16 Apr 2019 17:40:44 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1555425644; bh=LyeSBExoooDMdbkugMcPot7vAjUmHd2i5fq7SRyia1k=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=IkWymUMFGDSyfIl3YTl5h/wW/ujWLIKvmbSA+GBBigcKp9XBJ5+GU4CaAAfIDAAvL 0oi0uc/eag/ukC4O7K7riFK5XSoh5mIb4FCNT2O7ABlrA0kF761NjK/hDg4vdn1HzN Otgo0RhEHQwAu5grFcL6F30fah6OndqTWQn8LxFk= Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id MjrVIEt1Sd-ehaOSvrf; Tue, 16 Apr 2019 17:40:44 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Tue, 16 Apr 2019 17:39:47 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201812051425.wB5EP38T004562@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Gc4FCLxF5RLpVDUgQhYnJWt4CbwtXFWML" X-Rspamd-Queue-Id: EBEE98EC5A X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=IkWymUMF; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of bu7cher@yandex.ru designates 2a02:6b8:0:1a2d::608 as permitted sender) smtp.mailfrom=bu7cher@yandex.ru X-Spamd-Result: default: False [-9.87 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1a2d::/64]; FREEMAIL_FROM(0.00)[yandex.ru]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yandex.ru:+]; MX_GOOD(-0.01)[mx.yandex.ru,mx.yandex.ru,mx.yandex.ru,mx.yandex.ru,mx.yandex.ru]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[8.0.6.0.0.0.0.0.0.0.0.0.0.0.0.0.d.2.a.1.0.0.0.0.8.b.6.0.2.0.a.2.list.dnswl.org : 127.0.5.1]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yandex.ru.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; IP_SCORE(-3.70)[ip: (-9.84), ipnet: 2a02:6b8::/32(-4.81), asn: 13238(-3.85), country: RU(0.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: Tue, 16 Apr 2019 14:41:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Gc4FCLxF5RLpVDUgQhYnJWt4CbwtXFWML Content-Type: multipart/mixed; boundary="CkT7XhrlVpnZaZvea4uGJsDAgElFOplO3"; protected-headers="v1" From: "Andrey V. Elsukov" To: Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en References: <201812051425.wB5EP38T004562@repo.freebsd.org> In-Reply-To: <201812051425.wB5EP38T004562@repo.freebsd.org> --CkT7XhrlVpnZaZvea4uGJsDAgElFOplO3 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05.12.2018 17:25, Slava Shwartsman wrote: > Author: slavash > Date: Wed Dec 5 14:25:03 2018 > New Revision: 341586 > URL: https://svnweb.freebsd.org/changeset/base/341586 >=20 > Log: > mlx5en: Implement backpressure indication. > =20 > The backpressure indication is implemented using an unlimited rate ty= pe of > mbuf send tag. When the upper layers typically the socket layer has o= btained such > a tag, it can then query the destination driver queue for the current= > amount of space available in the send queue. > =20 > A single mbuf send tag may be referenced multiple times and a refcoun= t has been added > to the mlx5e_priv structure to track its usage. Because the send tag = resides > in the mlx5e_channel structure, there is no need to wait for refcount= s to reach > zero until the mlx4en(4) driver is detached. The channels structure i= s persistant > during the lifetime of the mlx5en(4) driver it belongs to and can so = be accessed > without any need of synchronization. > =20 > The mlx5e_snd_tag structure was extended to contain a type field, bec= ause there are now > two different tag types which end up in the driver which need to be d= istinguished. > =20 > Submitted by: hselasky@ > Approved by: hselasky (mentor) > MFC after: 1 week > Sponsored by: Mellanox Technologies > @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) > struct mlx5e_sq *sq; > int ret; > =20 > - sq =3D mlx5e_select_queue(ifp, mb); > - if (unlikely(sq =3D=3D NULL)) { > -#ifdef RATELIMIT > - /* Check for route change */ > - if (mb->m_pkthdr.snd_tag !=3D NULL && > - mb->m_pkthdr.snd_tag->ifp !=3D ifp) { > + if (mb->m_pkthdr.snd_tag !=3D NULL) { > + sq =3D mlx5e_select_queue_by_send_tag(ifp, mb); > + if (unlikely(sq =3D=3D NULL)) { > + /* Check for route change */ > + if (mb->m_pkthdr.snd_tag->ifp !=3D ifp) { > + /* Free mbuf */ > + m_freem(mb); > + > + /* > + * Tell upper layers about route > + * change and to re-transmit this > + * packet: > + */ > + return (EAGAIN); > + } Hi, I just discovered something strange and found that this commit is the cause. The test system has mlx5en 100G interface. It has two vlans: vlan500 and vlan100. Via vlan500 it receives some packets flows. Then it routes these packets into vlan100. But packets are dropped in mlx5e_xmit() with EAGAIN error code. # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' dtrace: description 'fbt::ip6_output:return ' matched 1 probe CPU ID FUNCTION:NAME 23 54338 ip6_output:return 35 16 54338 ip6_output:return 35 21 54338 ip6_output:return 35 22 54338 ip6_output:return 35 24 54338 ip6_output:return 35 23 54338 ip6_output:return 35 14 54338 ip6_output:return 35 ^C # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe CPU ID FUNCTION:NAME 16 69030 mlx5e_xmit:return 35 23 69030 mlx5e_xmit:return 35 26 69030 mlx5e_xmit:return 35 25 69030 mlx5e_xmit:return 35 24 69030 mlx5e_xmit:return 35 21 69030 mlx5e_xmit:return 35 26 69030 mlx5e_xmit:return 35 ^C The kernel config is GENERIC. 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty --=20 WBR, Andrey V. Elsukov --CkT7XhrlVpnZaZvea4uGJsDAgElFOplO3-- --Gc4FCLxF5RLpVDUgQhYnJWt4CbwtXFWML Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAly16TMACgkQAcXqBBDI oXoZfAf9Glf7TAruR75X9vsJ2J7jytk8xLTYCTW+U3kmjOToyIWEpmy1HNUDWN7p jjBvOijhFwZSXzV6mLL/Iy7D3xtomzl/a2Dn4sCKoM5TvYvHim2aQZtPlDnG3BI6 o4Qs705lnCl0li46Ilpmvv9wtdXCXqf9U9ayJe+3BPLojy/ryiXSrdT0EJyI0F3B d+pyntzQDw1EHlFXrn1paHiTkBjt1V+Hk7gwPP+w8jH6MnIj+Z2Awx6UpGbHfQ36 29JI087K98zG4AIadH0YPj0+myk2eVFzMSQj5Sr/LPU1HwPBtZzLVYD4zEjeRgKk GnzVIEoAWxkKU4Q3l2FgfM1csAMhWw== =yi8C -----END PGP SIGNATURE----- --Gc4FCLxF5RLpVDUgQhYnJWt4CbwtXFWML-- From owner-svn-src-head@freebsd.org Tue Apr 16 14:57:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E83631574B47; Tue, 16 Apr 2019 14:57:47 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4B58F763; Tue, 16 Apr 2019 14:57:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id a190so16736465ite.4; Tue, 16 Apr 2019 07:57:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qgI0QyqwibCE0ZvWkvfD+/y6SpJv87l7WvMQTv9Ex3c=; b=XHtvChG/UsLGTvZj0u5worzJUw97ITQUzWPJ0rCP+t5CPutNjwykw9LlkWcbDOwWaa dWhlToCDzr3RGmXLo/uC6d3dXsqRlF9lAHwNQXsdOLOX28AKjd5hvNV9JVP5gPAOj802 ZmJqAIVnp5beA/gfMUBFU8EQVkPdz5E7vUK+pBTSeFz3Zp/E0oLqj8EWP9eDgHPCddjz G0bOUGiFuVEuHhrJ5DnHFCpPC25PufUTYGKeebdKp9Av1e4IIfBvVrPL9sphZFrzkE0j dCjXXfeumaAb7OBsa1Du9bu3G5oUqRVlOdNtn2TQ7jWVNjr29AaOoZApaJJ3Oza22j1t 8v5g== X-Gm-Message-State: APjAAAVYxbUgtII/1NZV2+4iQo8qaQjNbLZNRK6QZkthvVK9KbpWKNHv GMsdgH0OWgZUqyYoCUJEhLzE85Iq71IrqLxJY4W5MJ17 X-Google-Smtp-Source: APXvYqxckqxppr7BbijL9g8DmCTkl2bWGdA3/cT2/qgxZ/JdRjttFp/3b3r9AAboKdTxAzCt2lUEnK1Cn8RJtkQf1X4= X-Received: by 2002:a24:57cf:: with SMTP id u198mr24688898ita.162.1555426665718; Tue, 16 Apr 2019 07:57:45 -0700 (PDT) MIME-Version: 1.0 References: <201903262245.x2QMjfYS021850@repo.freebsd.org> In-Reply-To: <201903262245.x2QMjfYS021850@repo.freebsd.org> From: Ed Maste Date: Tue, 16 Apr 2019 10:57:33 -0400 Message-ID: Subject: Re: svn commit: r345562 - in head/sys: amd64/amd64 i386/i386 To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0E4B58F763 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.180 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.73)[ip: (-7.50), ipnet: 209.85.128.0/17(-3.88), asn: 15169(-2.21), country: US(-0.06)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.77)[-0.766,0]; RCVD_IN_DNSWL_NONE(0.00)[180.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[180.166.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] 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, 16 Apr 2019 14:57:48 -0000 On Tue, 26 Mar 2019 at 18:45, Conrad Meyer wrote: > > Author: cem > Date: Tue Mar 26 22:45:41 2019 > New Revision: 345562 > URL: https://svnweb.freebsd.org/changeset/base/345562 > > Log: > x86: Use XSAVEOPT for fpusave(), when available > > Remove redundant npxsave_core definition while here. > > Suggested by: Anton Rang > Reviewed by: kib, Anton Rang > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D19665 Note that this introduced failures in the i386 CI tests, PR 236936. Investigation is ongoing and taking some time, in part because the behaviour may be different between an i386 userland in an amd64 jail versus running on an i386 kernel. From owner-svn-src-head@freebsd.org Tue Apr 16 15:16:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C498A1575389 for ; Tue, 16 Apr 2019 15:16:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFA76856E for ; Tue, 16 Apr 2019 15:16:45 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555427796; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=i4UwSlCa+lM6otFPmou3JSN554jT4G3koQGMsCdKDSvOUVhCm260HjE/aTzjMXT9RekN3p8xNsUm6 W3Iug85DfLFn7AGoyBVFWeZmBBXkY2H8GFT89S9SrmcXga1ssH2B1okfHiw0F7VmRI1l8CNY48IpGn Sq4p264APabKeqSWae7a6RZ0DCC6jUkHQ4c5c6wfvknkKN135NF46xK1DmZPkgtxaRxwcPkUA+GSJS IBHzSL/YIXsMsXSKuGznlzb39CDhaIxT70yyI47+9Pjq7RjBq9q4+IBcfIWF4cwTcel4KnbkSXE1EJ mVIQw89EbxfyakJ5PzhRaNNCSgp6VYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=RtYJYwibZADEGZTRMuMfVAKnVWFMrOjQmbgUyJGSp9I=; b=flukJ9nTMI6vZJ7BS2OX5C8DE0IhCVYMnar+x0XH0fPxlNHrLVPDkLCJRuwXbLoQqZvLVGuNO5tTG FKOkGRaFuGUcGI5aNCAx1WjvXi8R++ZK8PlG7YS2WDo5ZOlwYrerVziGr2lZ6E0a6fom7gnH1VT5CV /maGHRczo8LslWwfH8yzlwg0Mk0X3T6VBVGgHFjr9O13cNy1JA2ipIg1BnsvD2Q58zC1tVfrNCI2C2 1YfbaW6bxNXRVqVzqF84Ibz6jnfuSxfCCSNb6cB7VdmtMJD35B6UglatF+X22p/nw200vE9bLkvMYX Qypst1JbbKxisonNse98qyMTT2o8h6g== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=RtYJYwibZADEGZTRMuMfVAKnVWFMrOjQmbgUyJGSp9I=; b=ZP0m42yLfR01nQCNCSN+ejuX0Np59QXezPU3tHryKUd/SYUbCXDRxqn5RzhGWp8YSxW7i6FwOMx86 FMNcesX46wbRF5K0xg5k5po9gZ9FfVvugJ67WxvzgtEcX/xhcy7Z2MgyH+V0Fog8zXBuBIxhLrIELJ ZTsmdkbSNvWjrZ51h4u0kIAhYcAYYAI2rgw88PySiMLR9M7s+4g7KBHnpJSsOEDr3EIH5nJc20D74T 2dduOfwCP+lmgDjJ7U/0VX9z8A+Nv5AqI4dIHERfkNuYZhEFEDqKwFNg2WLK+UAvZQOSwKzjEI9sCl jH57HbV+GtMKenxiShkP4GxQh2NfBxQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 9c987bc4-605a-11e9-803b-31925da7267c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id 9c987bc4-605a-11e9-803b-31925da7267c; Tue, 16 Apr 2019 15:16:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3GFGTG9043223; Tue, 16 Apr 2019 09:16:29 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <310a420ee0b9e12249979d89dc4fa0d4cac5a8dc.camel@freebsd.org> Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys From: Ian Lepore To: Warner Losh , Emmanuel Vadot Cc: "Conrad E. Meyer" , Justin Hibbits , src-committers , svn-src-all , svn-src-head Date: Tue, 16 Apr 2019 09:16:29 -0600 In-Reply-To: References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2AFA76856E 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.981,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: Tue, 16 Apr 2019 15:16:46 -0000 On Tue, 2019-04-16 at 07:18 -0600, Warner Losh wrote: > On Tue, Apr 16, 2019, 7:04 AM Emmanuel Vadot > wrote: > > > On Mon, 15 Apr 2019 17:54:56 -0700 > > Conrad Meyer wrote: > > > > > On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer > > > wrote: > > > > E.g., the CI infrastructure for > > > > Riscv/Arm is/was generating minimal filesystem images and not > > > > populating /boot/entropy. > > > > > > I should add, I say "is/was" because I have a PR out which may > > > address > > > the problem: https://github.com/freebsd/freebsd-ci/pull/31 > > > > > > Best, > > > Conrad > > > > It's not only CI, all release images (memstick, iso) don't have > > a /boot/entropy. > > Also all arm/arm64 image don't have this file too. > > If /boot/entropy is needed and isn't present loader(8) should > > gather > > some entropy and pass this to the kernel for the first boot. > > > > Maybe we need to bootstrap the entropy file as part of buildworld. > I'm not > sure if the loader can find enough... > > Isn't a file full of data which is distributed in identical form to everyone the exact opposite of entropy? -- Ian From owner-svn-src-head@freebsd.org Tue Apr 16 15:17:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FCBD157545E; Tue, 16 Apr 2019 15:17:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3294469A69; Tue, 16 Apr 2019 15:17:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f67.google.com with SMTP id b6so17964184iog.0; Tue, 16 Apr 2019 08:17:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=eFxP0v23LemMLdkZtcNbFOfwMKUt3TlaL94W1NiItWM=; b=WN/Wu+tUjve206M7vbpTtsIBM38hOqHqZ/bJpULZyqWHocwTbdmae9GLc0AklaYWx1 XRTEMjBaOATA2TDFV8rAQtMS1tLEEOp9X+Ep2Lx2Hl8VABLxJR1h/xMAbTwpRZo+WaR5 cllOFiH/ZzWn8VSTRSyjDq5dT/HcOoTwDq4laJwxzMsaih90DUtbZ+2uT/MPBhTqkKhC XrMfY2F8cFRLot75QlgN5bj7sNpp/Qr04OJRKPdCPwRn2FFn5BU/+2O3rCFmua9h83F2 LgU8U6Xyc/pTD++I2bIquI1CXUye8g93ceJz+oqTk45WjB3psg0ZXFbCs5a56EoH4MGh tY3Q== X-Gm-Message-State: APjAAAVHJqsny/9QgNhkmQUZ76GzGhkPkQtDMWXSo2SgnEOm5/PHO10O +wr0AZ5/qPTnivh63BkNJK656S5u X-Google-Smtp-Source: APXvYqzMtYOFmmXyhWwet7Z8Urm1HPQUr1LNgKlj5oJH7NMyu1hZ89kb7xgRxys+6AyAfR6Bzi6nhQ== X-Received: by 2002:a6b:3c0e:: with SMTP id k14mr55214266iob.162.1555427855314; Tue, 16 Apr 2019 08:17:35 -0700 (PDT) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com. [209.85.166.174]) by smtp.gmail.com with ESMTPSA id t78sm9308473itb.39.2019.04.16.08.17.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 08:17:35 -0700 (PDT) Received: by mail-it1-f174.google.com with SMTP id y204so33599560itf.3; Tue, 16 Apr 2019 08:17:35 -0700 (PDT) X-Received: by 2002:a02:62ce:: with SMTP id d197mr22018379jac.91.1555427854989; Tue, 16 Apr 2019 08:17:34 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 08:17:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 3294469A69 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; TAGGED_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; 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: Tue, 16 Apr 2019 15:17:38 -0000 On Tue, Apr 16, 2019 at 6:19 AM Warner Losh wrote: > On Tue, Apr 16, 2019, 7:04 AM Emmanuel Vadot wrote: >> It's not only CI, all release images (memstick, iso) don't have >> a /boot/entropy. >> Also all arm/arm64 image don't have this file too. >> If /boot/entropy is needed and isn't present loader(8) should gather >> some entropy and pass this to the kernel for the first boot. > > Maybe we need to bootstrap the entropy file as part of buildworld. I'm not sure if the loader can find enough... Well, one thing we should explicitly *not do* is distribute the same "entropy" to everyone in released images. So there is some difficulty here. Buildworld does not know if the target of the build is a one-off or a release image. Something like makerelease still seems inappropriately dangerous. The idea of loader-provided entropy is not that it generates the entropy itself, but that it can access the /boot/ filesystem to load entropy and pass it to the kernel as a fake module. I think we have identified that at least stack_chk_init was silently broken on a number of systems, using non-random stack guards. Now it's loudly broken. Ed has proposed a happy medium where we can check, in stack_chk_init, if the random device is seeded (via new KPI) and give users a big stick tunable to proceed without entropy or not. For now, I think we would default that to "proceed" just to unbreak CI and any other sharp corners. But the goal would be to default that to "panic" eventually. I don't know enough about stack_chk_init to determine how late it can be seeded. It seems to have come in in r180012 as a component of -fstack-protector. I will do a little investigating. Suggestions on appropriate reviewers welcome (I think ru@ is no longer with the project). Best regards, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 15:26:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E96E1575909; Tue, 16 Apr 2019 15:26:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com [209.85.166.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 819F66A1FD; Tue, 16 Apr 2019 15:26:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f174.google.com with SMTP id 139so33152525ita.4; Tue, 16 Apr 2019 08:26:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=R3QHdhBE0wAXJqEX/hbhoSxwoL1vm79cNBx5w96AjVE=; b=Cve3GZMzzXlRbfSj40Nyptg5R2EnBC4HvPhPDldT+h4OM+B7VAmzDGpvNhH9//F9bA +S0etiK9iYWZcEug8Hoc10ont5c2tGoskysgvS+cHrNdvA+Znsa5OAGX8FBs52wXc8A8 ZVYIXch5BPJKuTj1SCfHbCpZSRHAZWFZVIiG5wQdxlZOv/oAapQvCYz0m3u8ipGeQrTW MK6/sKfR6uLH8vkK2kMdPHmCg97R7P7PzRx+rw8wrhtnyN2tgm9fmxhSjroQ9nYmD6Fv FjCi4WC/4ELah76oN6S2eCTqxESdb/ykfucdN98ps66FkhfwmOKwMUKS5cQ8UxsgkT24 yNng== X-Gm-Message-State: APjAAAX8HtvPHLLpR7EfvSeIbbFs3vQkfuw9ndydQuoFSOqPxare4Ebb ie+JZS93Xf3+tVVuzhd//bXLCqvQ X-Google-Smtp-Source: APXvYqz3KSusL9pulV/t81jll4NgiO3RAw1cZqG45O+UAwEMMrRlPE0q3iC4lSpRbNHdr5wdvMYGBg== X-Received: by 2002:a24:3587:: with SMTP id k129mr27842723ita.55.1555428411158; Tue, 16 Apr 2019 08:26:51 -0700 (PDT) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com. [209.85.166.176]) by smtp.gmail.com with ESMTPSA id f197sm10226339itf.5.2019.04.16.08.26.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 08:26:50 -0700 (PDT) Received: by mail-it1-f176.google.com with SMTP id w15so33199612itc.0; Tue, 16 Apr 2019 08:26:50 -0700 (PDT) X-Received: by 2002:a24:f949:: with SMTP id l70mr30805365ith.116.1555428410134; Tue, 16 Apr 2019 08:26:50 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416092402.4288bc90@titan.knownspace> In-Reply-To: <20190416092402.4288bc90@titan.knownspace> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 08:26:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Justin Hibbits Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 819F66A1FD 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]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 15:26:58 -0000 On Tue, Apr 16, 2019 at 7:24 AM Justin Hibbits wrote: > > Hi Conrad, > ... > [Power] does use bsdinstall to install. How is entropy loaded at startup, > which causes the problem noted in github? There are a couple very early load sources. loader(8) will load early-boot entropy from /boot/entropy and pass it to the kernel as a fake module (entropy_cache_load in loader.conf(5)), similar to cpu_microcode early load. The fallback option is random(4) itself groping into the filesystem during early auto-conf (SI_SUB_RANDOM:SI_ORDER_FOURTH, IIRC) to access /boot/entropy directly. > If it's loaded before > filesystems get mounted, that could be a problem for us, because /boot > is on a different filesystem (msdosfs, to be read by petitboot). > Petitboot also does not have a way to preload modules, so all we have > at startup, until spawning init, is the kernel. Yes, that seems potentially problematic. Can the Power kernel access the non-msdosfs root filesystem? Let's follow-up offline about PPC-specific early entropy seeding. I would much prefer we figure out a way to provide early entropy to Power than disabling or crippling every early random consumer on the arch. Do you know what the Linux folks do? On Power with darn, we could probably just spin in SI_ORDER_FOURTH until we have enough darn output to seed random. Similar for x86 CI images, I guess; though they do not have the loader problem, some people have non-bsdinstall installation methods. Thanks, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 15:31:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B33711575B63; Tue, 16 Apr 2019 15:31:24 +0000 (UTC) (envelope-from bde@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 530956A645; Tue, 16 Apr 2019 15:31:24 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 216A821824; Tue, 16 Apr 2019 15:31:24 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GFVNma070469; Tue, 16 Apr 2019 15:31:23 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GFVNY3070468; Tue, 16 Apr 2019 15:31:23 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904161531.x3GFVNY3070468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 16 Apr 2019 15:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346278 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 530956A645 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.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 15:31:25 -0000 Author: bde Date: Tue Apr 16 15:31:23 2019 New Revision: 346278 URL: https://svnweb.freebsd.org/changeset/base/346278 Log: Quick fix for slow clearing and context switches of large frame buffers with old kernels, by breaking the support for large frame buffers in the same way as for current kernels. Large frame buffers may be too large to map into kva, and the kernel (syscons) only uses the first screen page anyway, so r203535, r205557 and 248799 limit the buffer size in VESA modes to the first screen page, apparently without noticing that this breaks applications by using the same limit for user mappings as for kernel mappings. In vgl, this makes the virtual screen the same as the physical screen. However, this is almost a feature since clearing and switching large (usually mostly unused) frame buffers takes too long. E.g., on a 16 year old low-end AGP card it takes about 12 seconds to clear the 128MB frame buffer in old kernels that map it all and also map it with slow attributes (e.g., uncacheable). Older PCI cards are even slower, but usually have less memory. Newer PCIe cards are faster, but may have many GB of memory. Also, vgl malloc()s a shadow buffer with the same size as the frame buffer, so large frame buffers are even more wasteful in applications than in the kernel. Use the same limit in vgl as in newer kernels. Virtual screens and panning still work in non-VESA modes that have more than 1 page. The reduced buffer size in the kernel also breaks mmap() of the last physical page in modes where the reduced size is not a multiple of the physical page size. The same reduction in vgl only reduces the virtual screen size. Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Tue Apr 16 14:29:12 2019 (r346277) +++ head/lib/libvgl/main.c Tue Apr 16 15:31:23 2019 (r346278) @@ -264,6 +264,19 @@ VGLInit(int mode) else VGLBufSize = max(VGLAdpInfo.va_line_width*VGLModeInfo.vi_height, VGLAdpInfo.va_window_size)*VGLModeInfo.vi_planes; + /* + * The above is for old -CURRENT. Current -CURRENT since r203535 and/or + * r248799 restricts va_buffer_size to the displayed size in VESA modes to + * avoid wasting kva for mapping unused parts of the frame buffer. But all + * parts were usable here. Applying the same restriction to user mappings + * makes our virtualization useless and breaks our panning, but large frame + * buffers are also difficult for us to manage (clearing and switching may + * be too slow, and malloc() may fail). Restrict ourselves similarly to + * get the same efficiency and bugs for all kernels. + */ + if (0 && VGLModeInfo.vi_mode >= M_VESA_BASE) + VGLBufSize = 2*VGLAdpInfo.va_line_width*VGLModeInfo.vi_height* + VGLModeInfo.vi_planes; VGLBuf = malloc(VGLBufSize); if (VGLBuf == NULL) { VGLEnd(); From owner-svn-src-head@freebsd.org Tue Apr 16 15:31:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47FD01575B8F; Tue, 16 Apr 2019 15:31:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD6A16A760; Tue, 16 Apr 2019 15:31:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f172.google.com with SMTP id x132so33678448itf.2; Tue, 16 Apr 2019 08:31:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=4sbyXwolrkHUV7cTHS3f1Y+K3pIcvwA6A8om3rlYO9s=; b=gehsSA5KYyDY06l83HIEO+Wug+yEsR1rzKd8oTHX7cNIKeJKSPm0ipReJ6KTu7TyBe XymzfLuk9Y3PHWtpkZMcu4auGHCav05hdGlexCbDab0ENDPYNWvFskT3+LpRQ44yJ27c ky0x9i/PJqCAy3PxsJxxyoq+SPBAaGK+lV8EWJ6pCUiX/2c3TqayVZfqVSONjsaVJVtn WQrW4ebFqyJMN/mvl7HYBNU16h72mswsO+ug4X4I9g5W69lEPB0V+mwYX7CC/0QUBqw5 XkQQEE/VWTsbvGscVkkQ0NCmaSErt3tQCLg/iFP40yxt1bhD9V+kJzn48+afKj3/hs4d do9A== X-Gm-Message-State: APjAAAVQ4p0TMuqMWymKlMqBmNLKMq2aEj4ravWCv2HrrrtPbJcnmE3G AKXdImGCwenKYesmHdhHAybBuo+m X-Google-Smtp-Source: APXvYqzWqnkP3wAkMMlBCDd2UzLMI2o66rlAV8m7IBAg9l983ouUtR6BFQ6Tza6+mMp9ccJxsgNHmg== X-Received: by 2002:a24:4e05:: with SMTP id r5mr29305996ita.63.1555428693722; Tue, 16 Apr 2019 08:31:33 -0700 (PDT) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com. [209.85.166.176]) by smtp.gmail.com with ESMTPSA id k18sm19741523iob.60.2019.04.16.08.31.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 08:31:33 -0700 (PDT) Received: by mail-it1-f176.google.com with SMTP id s3so18945116itk.1; Tue, 16 Apr 2019 08:31:33 -0700 (PDT) X-Received: by 2002:a02:a399:: with SMTP id y25mr58476299jak.58.1555428693409; Tue, 16 Apr 2019 08:31:33 -0700 (PDT) MIME-Version: 1.0 References: <201904160228.x3G2SZIg057157@repo.freebsd.org> In-Reply-To: <201904160228.x3G2SZIg057157@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 08:31:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346259 - head/sys/dev/tpm To: Marcin Wojtas Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: DD6A16A760 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.990,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 15:31:35 -0000 Hi Marcin, Isn't this check racy? Thread TIDs are allocated from a fixed range and can be recycled. Best, Conrad On Mon, Apr 15, 2019 at 7:28 PM Marcin Wojtas wrote: > > Author: mw > Date: Tue Apr 16 02:28:35 2019 > New Revision: 346259 > URL: https://svnweb.freebsd.org/changeset/base/346259 > > Log: > tpm: Prevent session hijack > > Check caller thread id before allowing to read the buffer > to make sure that it can only be accessed by the thread that > did the associated write to the TPM. > > Submitted by: Kornel Duleba > Reviewed by: delphij > Obtained from: Semihalf > Sponsored by: Stormshield > Differential Revision: https://reviews.freebsd.org/D19713 > > Modified: > head/sys/dev/tpm/tpm20.c > head/sys/dev/tpm/tpm20.h > > Modified: head/sys/dev/tpm/tpm20.c > ============================================================================== > --- head/sys/dev/tpm/tpm20.c Tue Apr 16 02:12:38 2019 (r346258) > +++ head/sys/dev/tpm/tpm20.c Tue Apr 16 02:28:35 2019 (r346259) > @@ -77,6 +77,10 @@ tpm20_read(struct cdev *dev, struct uio *uio, int flag > > callout_stop(&sc->discard_buffer_callout); > sx_xlock(&sc->dev_lock); > + if (sc->owner_tid != uio->uio_td->td_tid) { > + sx_xunlock(&sc->dev_lock); > + return (EPERM); > + } > > bytes_to_transfer = MIN(sc->pending_data_length, uio->uio_resid); > if (bytes_to_transfer > 0) { > @@ -128,9 +132,11 @@ tpm20_write(struct cdev *dev, struct uio *uio, int fla > > result = sc->transmit(sc, byte_count); > > - if (result == 0) > + if (result == 0) { > callout_reset(&sc->discard_buffer_callout, > TPM_READ_TIMEOUT / tick, tpm20_discard_buffer, sc); > + sc->owner_tid = uio->uio_td->td_tid; > + } > > sx_xunlock(&sc->dev_lock); > return (result); > > Modified: head/sys/dev/tpm/tpm20.h > ============================================================================== > --- head/sys/dev/tpm/tpm20.h Tue Apr 16 02:12:38 2019 (r346258) > +++ head/sys/dev/tpm/tpm20.h Tue Apr 16 02:28:35 2019 (r346259) > @@ -120,6 +120,7 @@ struct tpm_sc { > > uint8_t *buf; > size_t pending_data_length; > + lwpid_t owner_tid; > > struct callout discard_buffer_callout; > #ifdef TPM_HARVEST > From owner-svn-src-head@freebsd.org Tue Apr 16 15:33:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 129C41575CEF; Tue, 16 Apr 2019 15:33:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BA876AA58; Tue, 16 Apr 2019 15:33:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 731FD2600C9; Tue, 16 Apr 2019 17:33:19 +0200 (CEST) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: "Andrey V. Elsukov" , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Baldwin References: <201812051425.wB5EP38T004562@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Tue, 16 Apr 2019 17:32:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9BA876AA58 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.981,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: Tue, 16 Apr 2019 15:33:28 -0000 On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: > On 05.12.2018 17:25, Slava Shwartsman wrote: >> Author: slavash >> Date: Wed Dec 5 14:25:03 2018 >> New Revision: 341586 >> URL: https://svnweb.freebsd.org/changeset/base/341586 >> >> Log: >> mlx5en: Implement backpressure indication. >> >> The backpressure indication is implemented using an unlimited rate type of >> mbuf send tag. When the upper layers typically the socket layer has obtained such >> a tag, it can then query the destination driver queue for the current >> amount of space available in the send queue. >> >> A single mbuf send tag may be referenced multiple times and a refcount has been added >> to the mlx5e_priv structure to track its usage. Because the send tag resides >> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >> zero until the mlx4en(4) driver is detached. The channels structure is persistant >> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >> without any need of synchronization. >> >> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >> two different tag types which end up in the driver which need to be distinguished. >> >> Submitted by: hselasky@ >> Approved by: hselasky (mentor) >> MFC after: 1 week >> Sponsored by: Mellanox Technologies >> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >> struct mlx5e_sq *sq; >> int ret; >> >> - sq = mlx5e_select_queue(ifp, mb); >> - if (unlikely(sq == NULL)) { >> -#ifdef RATELIMIT >> - /* Check for route change */ >> - if (mb->m_pkthdr.snd_tag != NULL && >> - mb->m_pkthdr.snd_tag->ifp != ifp) { >> + if (mb->m_pkthdr.snd_tag != NULL) { >> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >> + if (unlikely(sq == NULL)) { >> + /* Check for route change */ >> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >> + /* Free mbuf */ >> + m_freem(mb); >> + >> + /* >> + * Tell upper layers about route >> + * change and to re-transmit this >> + * packet: >> + */ >> + return (EAGAIN); >> + } > > Hi, > > I just discovered something strange and found that this commit is the > cause. > The test system has mlx5en 100G interface. It has two vlans: vlan500 and > vlan100. > Via vlan500 it receives some packets flows. Then it routes these packets > into vlan100. > But packets are dropped in mlx5e_xmit() with EAGAIN error code. > > # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' > dtrace: description 'fbt::ip6_output:return ' matched 1 probe > CPU ID FUNCTION:NAME > 23 54338 ip6_output:return 35 > 16 54338 ip6_output:return 35 > 21 54338 ip6_output:return 35 > 22 54338 ip6_output:return 35 > 24 54338 ip6_output:return 35 > 23 54338 ip6_output:return 35 > 14 54338 ip6_output:return 35 > ^C > > # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' > dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe > CPU ID FUNCTION:NAME > 16 69030 mlx5e_xmit:return 35 > 23 69030 mlx5e_xmit:return 35 > 26 69030 mlx5e_xmit:return 35 > 25 69030 mlx5e_xmit:return 35 > 24 69030 mlx5e_xmit:return 35 > 21 69030 mlx5e_xmit:return 35 > 26 69030 mlx5e_xmit:return 35 > ^C > > The kernel config is GENERIC. > 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty > Hi, This might be a case where rcvif in the mbuf's pktheader is not cleared before the packet is fed back on the wire. John Baldwin is working on the send tags implementation, to eliminate the EAGAIN handling in the network drivers. --HPS From owner-svn-src-head@freebsd.org Tue Apr 16 15:38:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D63201575F7B; Tue, 16 Apr 2019 15:38:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8326AD64; Tue, 16 Apr 2019 15:38:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f67.google.com with SMTP id p23so17964136iol.13; Tue, 16 Apr 2019 08:38:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=OUJgQGf+ZXyfyvyBDzEijMICKo/esjLnCmC4iMso6so=; b=Z7x8rJnhFsgkyONJW+Zyxf5U0nCTz4FnGVRcNFCnCsB254Kge3QPrY933c0c4aSPlL VClkWh4SaIDlbURIOm5xK62Ksjp7k64Jhb0mCVDVFzHzezF5Bo0b83o2LKEQzdq/yfLX V5cSmmncUfCjoGJ8edkxKwmQxlPuYQUfnMw46AQ3KutvKJP/ajzvyXS9z9ToN7j7n1ir 0c20/+O33g7092ckHEz9C1kCZvlk/CxVTbioi5yf8B8whafXxNQAk7dlqY6tQliRu2nF HKPyFY1/eYtJxN3BfxqTiS8XmVQ35PWhouU+PnznU2BseNPpJl9XnMqIR5NdyD/Tbqrr /5ig== X-Gm-Message-State: APjAAAX7Nm/clc0YQUZde5uTzZEvwLB20kIohIxKdjOgjxnduFynPcd1 NmrfMccv9zWeSrStkM4v5mUWMf9X X-Google-Smtp-Source: APXvYqwC70uQSuXJI6B6lufmEKe9HCRQGw6Yyo1+YQsEC63QkrAKDPh0qhn4tbwbdY5tFI5Uy6In4w== X-Received: by 2002:a5d:8757:: with SMTP id k23mr3627031iol.68.1555429083334; Tue, 16 Apr 2019 08:38:03 -0700 (PDT) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com. [209.85.166.174]) by smtp.gmail.com with ESMTPSA id b82sm9976220itd.12.2019.04.16.08.38.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 08:38:03 -0700 (PDT) Received: by mail-it1-f174.google.com with SMTP id 139so33216721ita.4; Tue, 16 Apr 2019 08:38:03 -0700 (PDT) X-Received: by 2002:a05:660c:111:: with SMTP id w17mr30434544itj.62.1555429082960; Tue, 16 Apr 2019 08:38:02 -0700 (PDT) MIME-Version: 1.0 References: <201904160412.x3G4CgN2015092@repo.freebsd.org> <20190416131915.2ocot4nonnf3sl4a@mutt-hbsd> In-Reply-To: <20190416131915.2ocot4nonnf3sl4a@mutt-hbsd> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 08:37:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346263 - head/contrib/tcpdump To: Shawn Webb Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 5B8326AD64 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.989,0]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 15:38:05 -0000 On Tue, Apr 16, 2019 at 6:20 AM Shawn Webb wrote: > Is there any documentation anywhere telling users that Capsicum > support will be disabled under certain circumstances? Hi Shawn, I don't think documenting that makes much sense in general. It would be extremely burdensome to fully document and quickly become desynchronized from the code. It's comparable to OpenBSD pledging differently in different paths of programs. To me, "for now," suggests that this is perhaps a temporary workaround and maybe we can do something better in the future. Take care, Conrad P.S., When do you plan to update your Easy Feature Comparison page to reflect that FreeBSD has the same procfs and "boot hardening" as HBSD? From owner-svn-src-head@freebsd.org Tue Apr 16 15:38:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38AB91575FC3; Tue, 16 Apr 2019 15:38:42 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from sc1.bsdpad.com (sc1.bsdpad.com [163.172.212.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEE3C6AE73; Tue, 16 Apr 2019 15:38:41 +0000 (UTC) (envelope-from br@bsdpad.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bsdpad.com; s=20190317; h=Subject:To:From; bh=OsYhejS53f94T0bxTqlhHLg1wLoDKuBQljywxkCpbj0=; b=QOkgq8Y7ZjCQ2xO1PCXt5MNLiy D8jnNvgOI5xW8PuHuPdYNe/2KkPE4rHNrGUJQmyQH0lNKGkDIGBAD7iq+TSs2iVvYCc9/f6LAkZKf dk0t0ASr3LVVfT9+tLLmVi6RdRPHlMhacvf52Utva9JvuYs9n2qH89XiWYJh+rJvD2VPMKzOf6Nvm 7pdNYg4KPewYKg2bck5xs6hhGNLYf9NKiDFe/UEK6SlhAEGJtXgYT80VAQdfZVXtsekZ3bUbwGL0J peWGjmpwG6t6ZL4sBMjPrkSonAX3dYzWDrN0XapxQdwas9cN/0CIqpSf1QtwE4Ds9tWK0E+P3sNNR pOjXt5Yw==; Received: from localhost ([127.0.0.1] helo=bsdpad.com) by sc1.bsdpad.com with smtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1hGQA4-0005Uh-O8; Tue, 16 Apr 2019 16:38:16 +0100 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Tue, 16 Apr 2019 16:38:16 +0100 (BST) Date: Tue, 16 Apr 2019 16:38:16 +0100 From: Ruslan Bukin To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys Message-ID: <20190416153816.GA20965@bsdpad.com> References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201904151840.x3FIeaEQ009242@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: AEE3C6AE73 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.980,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: Tue, 16 Apr 2019 15:38:42 -0000 Hi I just got this: UART 16550 configured with options: baud = 115200 | freq = 50000000 bbl loader vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv rr vvvvvvvvvvvvvvvvvvvvvv rr vvvvvvvvvvvvvvvvvvvvvvvv rr rrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrr rrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrr rrrrrrrr vvvvvvvvvvvvvvvvvv rrrrrrrr rrrrrrrrrr vvvvvvvvvvvvvv rrrrrrrrrr rrrrrrrrrrrr vvvvvvvvvv rrrrrrrrrrrr rrrrrrrrrrrrrr vvvvvv rrrrrrrrrrrrrr rrrrrrrrrrrrrrrr vv rrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr INSTRUCTION SETS WANT TO BE FREE physmap[0] = 0x00000000c0000000 physmap[1] = 0x00000000c1200000 physmap[2] = 0x00000000c1300000 physmap[3] = 0x0000000100000000 pmap_bootstrap ffffffc0005c6000 c0000000 e00958 ffffffc0005c6000 100 physmap_idx 4 min_pa c0000000 max_pa 100000000 ---<>--- KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2019 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 13.0-CURRENT #496 999d9e9b642(master)-dirty: Tue Apr 16 16:23:48 BST 2019 br@pie:/usr/home/br/obj/usr/home/br/dev/freebsd-riscv/riscv.riscv64/sys/GENERIC riscv gcc version 8.2.0 (GCC) Preloaded elf64 kernel "kernel" at 0xffffffc000dfeda0. CPU(0): Unknown Implementer Unknown Processor random: randomdev_wait_until_seeded unblock wait t[0] == 0x0000000000000000 t[1] == 0x0000000000000000 t[2] == 0xffffffc0004e86d8 t[3] == 0x0000000000000000 t[4] == 0x0000000000000000 t[5] == 0x0000000000000000 t[6] == 0x0000000000000000 s[0] == 0xffffffc000003b00 s[1] == 0xffffffc000da5920 s[2] == 0xffffffc000da5920 s[3] == 0x0000000000000000 s[4] == 0x0000000000000000 s[5] == 0xffffffc0005cf4d0 s[6] == 0xffffffc0004fc948 s[7] == 0xffffffc000da5920 s[8] == 0x0000000000000000 s[9] == 0xffffffc000d45a80 s[10] == 0x0000000000000000 s[11] == 0x000000001999997c a[0] == 0xffffffc000da5920 a[1] == 0x0000000000000000 a[2] == 0xffffffc0004fc948 a[3] == 0x0000000000000900 a[4] == 0xffffffc000da5920 a[5] == 0x0000000000000000 a[6] == 0x0000000000000100 a[7] == 0x0000000000000001 sepc == 0xffffffc0001f8d3c sstatus == 0x8000000200006100 panic: Fatal page fault at 0xffffffc0001f8d3c: 0x00000000000018 time = 1 KDB: stack backtrace: db_trace_self() at db_read_token+0x5e2 pc = 0xffffffc0004c726a ra = 0xffffffc0000ca1de sp = 0xffffffc0000035f8 fp = 0xffffffc000003818 db_read_token() at kdb_backtrace+0x2e pc = 0xffffffc0000ca1de ra = 0xffffffc00024c9d2 sp = 0xffffffc000003818 fp = 0xffffffc000003828 kdb_backtrace() at vpanic+0x124 pc = 0xffffffc00024c9d2 ra = 0xffffffc000212aaa sp = 0xffffffc000003828 fp = 0xffffffc000003868 vpanic() at panic+0x22 pc = 0xffffffc000212aaa ra = 0xffffffc000212ae2 sp = 0xffffffc000003868 fp = 0xffffffc000003888 panic() at sysarch+0x3ba pc = 0xffffffc000212ae2 ra = 0xffffffc0004d2cfc sp = 0xffffffc000003888 fp = 0xffffffc000003998 sysarch() at do_trap_supervisor+0x4e pc = 0xffffffc0004d2cfc ra = 0xffffffc0004d2df6 sp = 0xffffffc000003998 fp = 0xffffffc0000039b8 do_trap_supervisor() at cpu_exception_handler_supervisor+0x68 pc = 0xffffffc0004d2df6 ra = 0xffffffc0004c78f8 sp = 0xffffffc0000039b8 fp = 0xffffffc000003b00 cpu_exception_handler_supervisor() at sleepq_add+0x46 pc = 0xffffffc0004c78f8 ra = 0xffffffc00025919e sp = 0xffffffc000003b00 fp = 0xffffffc000003b40 sleepq_add() at _sleep+0x2d0 pc = 0xffffffc00025919e ra = 0xffffffc00021b892 sp = 0xffffffc000003b40 fp = 0xffffffc000003be0 _sleep() at random_harvest_deregister_source+0x132 pc = 0xffffffc00021b892 ra = 0xffffffc0000ed172 sp = 0xffffffc000003be0 fp = 0xffffffc000003c50 random_harvest_deregister_source() at read_random+0xc4 pc = 0xffffffc0000ed172 ra = 0xffffffc0000ed752 sp = 0xffffffc000003c50 fp = 0xffffffc000003ca0 read_random() at vn_fsync_buf+0x594 pc = 0xffffffc0000ed752 ra = 0xffffffc0002caa40 sp = 0xffffffc000003ca0 fp = 0xffffffc000003d00 vn_fsync_buf() at arc4rand+0xd4 pc = 0xffffffc0002caa40 ra = 0xffffffc0002cac04 sp = 0xffffffc000003d00 fp = 0xffffffc000003d90 arc4rand() at sched_tdname+0x4c pc = 0xffffffc0002cac04 ra = 0xffffffc00023a290 sp = 0xffffffc000003d90 fp = 0xffffffc000003de0 sched_tdname() at mi_startup+0x20c pc = 0xffffffc00023a290 ra = 0xffffffc0001bb98e sp = 0xffffffc000003de0 fp = 0xffffffc000003e70 mi_startup() at 0xffffffc0000001a6 pc = 0xffffffc0001bb98e ra = 0xffffffc0000001a6 sp = 0xffffffc000003e70 fp = 0x00000000c0200000 KDB: enter: panic --- We don't have loader(8) support for RISC-V and we don't have any hardware with random number generators yet. Most of our fpga/hardware has no way to have rootfs at all (we use mdroot). We use BBL bootloader to boot freebsd. BBL embeds freebsd kernel to the BBL binary on a compile time (similar way how we embed mdroot to kernel). Once BBL initialized itself it jumps to the pre-defined address of payload which is freebsd kernel. So I'm pondering what is our current option, i.e. how to feed entropy in this case ? Thanks Ruslan On Mon, Apr 15, 2019 at 06:40:36PM +0000, Conrad Meyer wrote: > Author: cem > Date: Mon Apr 15 18:40:36 2019 > New Revision: 346250 > URL: https://svnweb.freebsd.org/changeset/base/346250 > > Log: > random(4): Block read_random(9) on initial seeding > > read_random() is/was used, mostly without error checking, in a lot of > very sensitive places in the kernel -- including seeding the widely used > arc4random(9). > > Most uses, especially arc4random(9), should block until the device is seeded > rather than proceeding with a bogus or empty seed. I did not spy any > obvious kernel consumers where blocking would be inappropriate (in the > sense that lack of entropy would be ok -- I did not investigate locking > angle thoroughly). In many instances, arc4random_buf(9) or that family > of APIs would be more appropriate anyway; that work was done in r345865. > > A minor cleanup was made to the implementation of the READ_RANDOM function: > instead of using a variable-length array on the stack to temporarily store > all full random blocks sufficient to satisfy the requested 'len', only store > a single block on the stack. This has some benefit in terms of reducing > stack usage, reducing memcpy overhead and reducing devrandom output leakage > via the stack. Additionally, the stack block is now safely zeroed if it was > used. > > One caveat of this change is that the kern.arandom sysctl no longer returns > zero bytes immediately if the random device is not seeded. This means that > FreeBSD-specific userspace applications which attempted to handle an > unseeded random device may be broken by this change. If such behavior is > needed, it can be replaced by the more portable getrandom(2) GRND_NONBLOCK > option. > > On any typical FreeBSD system, entropy is persisted on read/write media and > used to seed the random device very early in boot, and blocking is never a > problem. > > This change primarily impacts the behavior of /dev/random on embedded > systems with read-only media that do not configure "nodevice random". We > toggle the default from 'charge on blindly with no entropy' to 'block > indefinitely.' This default is safer, but may cause frustration. Embedded > system designers using FreeBSD have several options. The most obvious is to > plan to have a small writable NVRAM or NAND to persist entropy, like larger > systems. Early entropy can be fed from any loader, or by writing directly > to /dev/random during boot. Some embedded SoCs now provide a fast hardware > entropy source; this would also work for quickly seeding Fortuna. A 3rd > option would be creating an embedded-specific, more simplistic random > module, like that designed by DJB in [1] (this design still requires a small > rewritable media for forward secrecy). Finally, the least preferred option > might be "nodevice random", although I plan to remove this in a subsequent > revision. > > To help developers emulate the behavior of these embedded systems on > ordinary workstations, the tunable kern.random.block_seeded_status was > added. When set to 1, it blocks the random device. > > I attempted to document this change in random.4 and random.9 and ran into a > bunch of out-of-date or irrelevant or inaccurate content and ended up > rototilling those documents more than I intended to. Sorry. I think > they're in a better state now. > > PR: 230875 > Reviewed by: delphij, markm (earlier version) > Approved by: secteam(delphij), devrandom(markm) > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D19744 > > Modified: > head/share/man/man4/random.4 > head/share/man/man9/random.9 > head/sys/dev/random/fortuna.c > head/sys/dev/random/random_harvestq.c > head/sys/dev/random/random_infra.c > head/sys/dev/random/randomdev.c > head/sys/dev/random/randomdev.h > head/sys/kern/kern_mib.c > head/sys/libkern/arc4random.c > head/sys/sys/random.h > > Modified: head/share/man/man4/random.4 > ============================================================================== > --- head/share/man/man4/random.4 Mon Apr 15 17:54:40 2019 (r346249) > +++ head/share/man/man4/random.4 Mon Apr 15 18:40:36 2019 (r346250) > @@ -23,7 +23,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 26, 2018 > +.Dd April 15, 2019 > .Dt RANDOM 4 > .Os > .Sh NAME > @@ -32,63 +32,44 @@ > .Sh SYNOPSIS > .Cd "device random" > .Cd "options RANDOM_LOADABLE" > +.Cd "options RANDOM_ENABLE_ETHER" > .Cd "options RANDOM_ENABLE_UMA" > .Sh DESCRIPTION > The > .Nm > -device > -returns an endless supply of random bytes when read. > -It also accepts and reads data > -as any ordinary file. > +device returns an endless supply of random bytes when read. > .Pp > The generator will start in an > .Em unseeded > -state, and will block reads until > -it is seeded for the first time. > -This may cause trouble at system boot > -when keys and the like > -are generated from > -.Nm > -so steps should be taken to ensure a > -seeding as soon as possible. > +state, and will block reads until it is seeded for the first time. > .Pp > -It is also possible > -to read random bytes > -by using the KERN_ARND sysctl. > -On the command line > -this could be done by > +To provide prompt access to the random device at boot time, > +.Fx > +automatically persists some entropy data in > +.Pa /boot/entropy > +for the loader to provide to the kernel. > +Additional entropy is regularly saved in > +.Pa /var/db/entropy . > +This saved entropy is sufficient to unblock the random device on devices with > +writeable media. > .Pp > -.Dl "sysctl -x -B 16 kern.arandom" > +Embedded applications without writable media must determine their own scheme > +for re-seeding the random device on boot, or accept that the device > +will remain unseeded and block reads indefinitely. > +See > +.Sx SECURITY CONSIDERATIONS > +for more detail. > .Pp > -This sysctl will not return > -random bytes unless > -the > -.Nm > -device is seeded. > +In addition to > +.Xr read 2 , > +the direct output of the abstract kernel entropy device can be read with > +.Xr getrandom 2 , > +.Xr getentropy 3 , > +or the > +.Xr sysctl 8 > +pseudo-variable > +.Va kern.arandom . > .Pp > -This initial seeding > -of random number generators > -is a bootstrapping problem > -that needs very careful attention. > -In some cases, > -it may be difficult > -to find enough randomness > -to seed a random number generator > -until a system is fully operational, > -but the system requires random numbers > -to become fully operational. > -It is (or more accurately should be) > -critically important that the > -.Nm > -device is seeded > -before the first time it is used. > -In the case where a dummy or "blocking-only" > -device is used, > -it is the responsibility > -of the system architect > -to ensure that no blocking reads > -hold up critical processes. > -.Pp > To see the current settings of the software > .Nm > device, use the command line: > @@ -97,17 +78,20 @@ device, use the command line: > .Pp > which results in something like: > .Bd -literal -offset indent > +kern.random.block_seeded_status: 0 > kern.random.fortuna.minpoolsize: 64 > -kern.random.harvest.mask_symbolic: [HIGH_PERFORMANCE], ... ,CACHED > -kern.random.harvest.mask_bin: 00111111111 > -kern.random.harvest.mask: 511 > +kern.random.harvest.mask_symbolic: ENABLEDSOURCE,[DISABLEDSOURCE],...,CACHED > +kern.random.harvest.mask_bin: 00000010000000111011111 > +kern.random.harvest.mask: 66015 > +kern.random.use_chacha20_cipher: 0 > kern.random.random_sources: 'Intel Secure Key RNG' > .Ed > .Pp > Other than > -.Dl kern.random.fortuna.minpoolsize > +.Va kern.random.block_seeded_status , > +.Va kern.random.fortuna.minpoolsize , > and > -.Dl kern.random.harvest.mask > +.Va kern.random.harvest.mask , > all settings are read-only. > .Pp > The > @@ -137,17 +121,66 @@ and > .Va kern.random.harvest.mask_symbolic > sysctls > can be used to confirm > -that the choices are correct. > -Note that disabled items > +settings in a human readable form. > +Disabled items > in the latter item > are listed in square brackets. > See > .Xr random_harvest 9 > for more on the harvesting of entropy. > +.Sh FILES > +.Bl -tag -width ".Pa /dev/urandom" > +.It Pa /dev/random > +.It Pa /dev/urandom > +.El > +.Sh SEE ALSO > +.Xr getrandom 2 , > +.Xr arc4random 3 , > +.Xr getentropy 3 , > +.Xr random 3 , > +.Xr sysctl 8 , > +.Xr random 9 > +.Rs > +.%A Ferguson > +.%A Schneier > +.%A Kohno > +.%B Cryptography Engineering > +.%I Wiley > +.%O ISBN 978-0-470-47424-2 > +.Re > +.Sh HISTORY > +A > +.Nm > +device appeared in > +.Fx 2.2 . > +The implementation was changed to the > +.Em Yarrow algorithm in > +.Fx 5.0 . > +In > +.Fx 11.0 , > +the Fortuna algorithm was introduced as the default. > +In > +.Fx 12.0 , > +Yarrow was removed entirely. > +.Sh AUTHORS > +.An -nosplit > +The current > +.Nm > +code was authored by > +.An Mark R V Murray , > +with significant contributions from many people. > .Pp > +The > +.Em Fortuna > +algorithm was designed by > +.An Niels Ferguson , > +.An Bruce Schneier , > +and > +.An Tadayoshi Kohno . > +.Sh CAVEATS > When > .Cd "options RANDOM_LOADABLE" > -is used, > +is enabled, > the > .Pa /dev/random > device is not created > @@ -155,13 +188,9 @@ until an "algorithm module" > is loaded. > The only module built by default is > .Em random_fortuna . > -The > -.Em random_yarrow > -module was removed in > -.Fx 12 . > -Note that this loadable module > -is slightly less efficient > -than its compiled-in equivalent. > +Loadable random modules > +are less efficient > +than their compiled-in equivalents. > This is because some functions > must be locked against > load and unload events, > @@ -170,174 +199,40 @@ to allow for removal. > .Pp > When > .Cd "options RANDOM_ENABLE_UMA" > -is used, > +is enabled, > the > .Pa /dev/random > device will obtain entropy > from the zone allocator. > -This is potentially very high rate, > -and if so will be of questionable use. > -If this is the case, > -use of this option > -is not recommended. > -Determining this is not trivial, > -so experimenting and measurement > -using tools such as > -.Xr dtrace 1 > -will be required. > -.Sh RANDOMNESS > -The use of randomness in the field of computing > -is a rather subtle issue because randomness means > -different things to different people. > -Consider generating a password randomly, > -simulating a coin tossing experiment or > -choosing a random back-off period when a server does not respond. > -Each of these tasks requires random numbers, > -but the random numbers in each case have different requirements. > +This is a very high rate source with significant performance impact. > +Therefore, it is disabled by default. > .Pp > -Generation of passwords, session keys and the like > -requires cryptographic randomness. > -A cryptographic random number generator should be designed > -so that its output is difficult to guess, > -even if a lot of auxiliary information is known > -(such as when it was seeded, subsequent or previous output, and so on). > -On > -.Fx , > -seeding for cryptographic random number generators is provided by the > +When > +.Cd "options RANDOM_ENABLE_ETHER" > +is enabled, the > .Nm > -device, > -which provides real randomness. > -The > -.Xr arc4random 3 > -library call provides a pseudo-random sequence > -which is generally reckoned to be suitable for > -simple cryptographic use. > -The OpenSSL library also provides functions for managing randomness > -via functions such as > -.Xr RAND_bytes 3 > -and > -.Xr RAND_add 3 . > -Note that OpenSSL uses the > -.Nm > -device for seeding automatically. > +device will obtain entropy from > +.Vt mbuf > +structures passing through the network stack. > +This source is both extremely expensive and a poor source of entropy, so it is > +disabled by default. > +.Sh SECURITY CONSIDERATIONS > +The initial seeding > +of random number generators > +is a bootstrapping problem > +that needs very careful attention. > +When writable media is available, the > +.Em Fortuna > +paper describes a robust system for rapidly reseeding the device. > .Pp > -Randomness for simulation is required in engineering or > -scientific software and games. > -The first requirement of these applications is > -that the random numbers produced conform to some well-known, > -usually uniform, distribution. > -The sequence of numbers should also appear numerically uncorrelated, > -as simulation often assumes independence of its random inputs. > -Often it is desirable to reproduce > -the results of a simulation exactly, > -so that if the generator is seeded in the same way, > -it should produce the same results. > -A peripheral concern for simulation is > -the speed of a random number generator. > +In some embedded cases, it may be difficult to find enough randomness to seed a > +random number generator until a system is fully operational. > +In these cases, is the responsibility of the system architect to ensure that > +blocking is acceptable, or that the random device is seeded. > +(This advice does not apply to typical consumer systems.) > .Pp > -Another issue in simulation is > -the size of the state associated with the random number generator, and > -how frequently it repeats itself. > -For example, > -a program which shuffles a pack of cards should have 52!\& possible outputs, > -which requires the random number generator to have 52!\& starting states. > -This means the seed should have at least log_2(52!) ~ 226 bits of state > -if the program is to stand a chance of outputting all possible sequences, > -and the program needs some unbiased way of generating these bits. > -Again, > -the > +To emulate embedded systems, developers may set the > +.Va kern.random.block_seeded_status > +tunable to 1 to verify boot does not require early availability of the > .Nm > -device could be used for seeding here, > -but in practice, smaller seeds are usually considered acceptable. > -.Pp > -.Fx > -provides two families of functions which are considered > -suitable for simulation. > -The > -.Xr random 3 > -family of functions provides a random integer > -between 0 to > -.if t 2\u\s731\s10\d\(mi1. > -.if n (2**31)\(mi1. > -The functions > -.Xr srandom 3 , > -.Xr initstate 3 > -and > -.Xr setstate 3 > -are provided for deterministically setting > -the state of the generator and > -the function > -.Xr srandomdev 3 > -is provided for setting the state via the > -.Nm > device. > -The > -.Xr drand48 3 > -family of functions are also provided, > -which provide random floating point numbers in various ranges. > -.Pp > -Randomness that is used for collision avoidance > -(for example, in certain network protocols) > -has slightly different semantics again. > -It is usually expected that the numbers will be uniform, > -as this produces the lowest chances of collision. > -Here again, > -the seeding of the generator is very important, > -as it is required that different instances of > -the generator produce independent sequences. > -However, the guessability or reproducibility of the sequence is unimportant, > -unlike the previous cases. > -.Pp > -.Fx > -does also provide the traditional > -.Xr rand 3 > -library call, > -for compatibility purposes. > -However, > -it is known to be poor for simulation and > -absolutely unsuitable for cryptographic purposes, > -so its use is discouraged. > -.Sh FILES > -.Bl -tag -width ".Pa /dev/random" > -.It Pa /dev/random > -.El > -.Sh SEE ALSO > -.Xr arc4random 3 , > -.Xr drand48 3 , > -.Xr rand 3 , > -.Xr RAND_add 3 , > -.Xr RAND_bytes 3 , > -.Xr random 3 , > -.Xr sysctl 8 , > -.Xr random 9 > -.Rs > -.%A Ferguson > -.%A Schneier > -.%A Kohno > -.%B Cryptography Engineering > -.%I Wiley > -.%O ISBN 978-0-470-47424-2 > -.Re > -.Sh HISTORY > -A > -.Nm > -device appeared in > -.Fx 2.2 . > -The current software implementation, > -introduced in > -.Fx 10.0 , > -is by > -.An Mark R V Murray , > -and is an implementation of the > -.Em Fortuna > -algorithm by Ferguson > -.Em et al . > -It replaces the previous > -.Em Yarrow > -implementation, > -introduced in > -.Fx 5.0 . > -The Yarrow algorithm > -is no longer supported > -by its authors, > -and is therefore no longer available. > > Modified: head/share/man/man9/random.9 > ============================================================================== > --- head/share/man/man9/random.9 Mon Apr 15 17:54:40 2019 (r346249) > +++ head/share/man/man9/random.9 Mon Apr 15 18:40:36 2019 (r346250) > @@ -26,12 +26,13 @@ > .\" > .\" $FreeBSD$ > .\" " > -.Dd July 16, 2015 > +.Dd April 15, 2019 > .Dt RANDOM 9 > .Os > .Sh NAME > .Nm arc4rand , > .Nm arc4random , > +.Nm arc4random_buf , > .Nm random , > .Nm read_random , > .Nm read_random_uio , > @@ -39,86 +40,72 @@ > .Nd supply pseudo-random numbers > .Sh SYNOPSIS > .In sys/libkern.h > +.Ft uint32_t > +.Fn arc4random "void" > .Ft void > -.Fn srandom "u_long seed" > -.Ft u_long > -.Fn random "void" > +.Fn arc4random_buf "void *ptr" "size_t len" > .Ft void > .Fn arc4rand "void *ptr" "u_int length" "int reseed" > -.Ft uint32_t > -.Fn arc4random "void" > .Pp > .In sys/random.h > -.Ft int > +.Ft void > .Fn read_random "void *buffer" "int count" > .Ft int > .Fn read_random_uio "struct uio *uio" "bool nonblock" > +.Ss LEGACY ROUTINES > +.In sys/libkern.h > +.Ft void > +.Fn srandom "u_long seed" > +.Ft u_long > +.Fn random "void" > .Sh DESCRIPTION > The > -.Fn random > -function will by default produce > -a sequence of numbers > -that can be duplicated > -by calling > -.Fn srandom > -with some constant > -as the > -.Fa seed . > -The > -.Fn srandom > -function may be called with any arbitrary > -.Fa seed > -value to get slightly more unpredictable numbers. > -It is important to remember that the > -.Fn random > -function is entirely predictable, > -and is therefore not of use where > -knowledge of the sequence of numbers > -may be of benefit to an attacker. > +.Fn arc4random > +and > +.Fn arc4random_buf > +functions will return very good quality random numbers, suited for > +security-related purposes. > +Both are wrappers around the underlying > +.Fn arc4rand > +interface. > +.Fn arc4random > +returns a 32-bit random value, while > +.Fn arc4random_buf > +fills > +.Fa ptr > +with > +.Fa len > +bytes of random data. > .Pp > The > .Fn arc4rand > -function will return very good quality random numbers, > -better suited > -for security-related purposes. > -The random numbers from > -.Fn arc4rand > -are seeded from the entropy device > -if it is available. > -Automatic reseeds happen > -after a certain timeinterval > -and after a certain number of bytes > -have been delivered. > -A forced reseed > -can be forced > -by passing a non-zero > -value in the > +CSPRNG > +is seeded from the > +.Xr random 4 > +kernel abstract entropy device. > +Automatic reseeding happens at unspecified time and bytes (of output) > +intervals. > +A reseed can be forced by passing a non-zero > .Fa reseed > -argument. > +value. > .Pp > The > .Fn read_random > -function is used to return entropy directly from the entropy device > -if it has been loaded. > -If the entropy device is not loaded, then > -the > +function is used to read entropy directly from the kernel abstract entropy > +device. > +.Fn read_random > +blocks if and until the entropy device is seeded. > +The provided > .Fa buffer > -is ignored > -and zero is returned. > -The > -.Fa buffer > is filled with no more than > .Fa count > bytes. > It is strongly advised that > .Fn read_random > -is not used; > -instead use > +is not used directly; > +instead, use the > .Fn arc4rand > -unless it is > -necessary to know > -that no entropy > -has been returned. > +family of functions. > .Pp > The > .Fn read_random_uio > @@ -129,50 +116,35 @@ on > The > .Fa uio > argument points to a buffer where random data should be stored. > -This function only returns data if the random device is seeded. > -It blocks if unseeded, > -except when the > +If > .Fa nonblock > -argument is true. > +is true and the random device is not seeded, this function does not return any > +data. > +Otherwise, this function may block interruptibly until the random device is seeded. > +If the function is interrupted before the random device is seeded, no data is > +returned. > .Pp > -All the bits returned by > -.Fn random , > -.Fn arc4rand , > -.Fn read_random , > -and > -.Fn read_random_uio > -are usable. > -For example, > -.Sq Li random()&01 > -will produce a random binary value. > -.Pp > -The > -.Fn arc4random > -is a convenience function which calls > -.Fn arc4rand > -to return a 32 bit pseudo-random integer. > +The legacy > +.Fn random > +function will produce a sequence of numbers that can be duplicated by calling > +.Fn srandom > +with some constant as the > +.Fa seed . > +The legacy > +.Fn srandom > +function may be called with any > +.Fa seed > +value. > +It is strongly advised that the > +.Fn random > +function not be used to generate random numbers. > +See > +.Sx SECURITY CONSIDERATIONS . > .Sh RETURN VALUES > The > -.Fn random > -function uses > -a non-linear additive feedback random number generator > -employing a default table > -of size 31 > -containing long integers > -to return successive pseudo-random > -numbers in the range from 0 to > -.if t 2\u\s731\s10\d\(mi1. > -.if n (2**31)\(mi1. > -The period of this random number generator > -is very large, > -approximately > -.if t 16\(mu(2\u\s731\s10\d\(mi1). > -.if n 16*((2**31)\(mi1). > -.Pp > -The > .Fn arc4rand > -function uses the RC4 algorithm > -to generate successive pseudo-random bytes. > +function uses the Chacha20 algorithm to generate a pseudo-random sequence of > +bytes. > The > .Fn arc4random > function uses > @@ -191,6 +163,23 @@ the number of bytes placed in > .Fn read_random_uio > returns zero when successful, > otherwise an error code is returned. > +.Pp > +The legacy > +.Fn random > +function uses > +a non-linear additive feedback random number generator > +employing a default table > +of size 31 > +containing long integers > +to return successive pseudo-random > +numbers in the range from 0 to > +.if t 2\u\s731\s10\d\(mi1. > +.if n (2**31)\(mi1. > +The period of this random number generator > +is very large, > +approximately > +.if t 16\(mu(2\u\s731\s10\d\(mi1). > +.if n 16*((2**31)\(mi1). > .Sh ERRORS > .Fn read_random_uio > may fail if: > @@ -210,3 +199,19 @@ wrote > .An Mark R V Murray > wrote > .Fn read_random . > +.Sh SECURITY CONSIDERATIONS > +Do not use > +.Fn random > +or > +.Fn srandom > +in new code. > +.Pp > +It is important to remember that the > +.Fn random > +function is entirely predictable. > +It is easy for attackers to predict future output of > +.Fn random > +by recording some generated values. > +We cannot emphasize strongly enough that > +.Fn random > +must not be used to generate values that are intended to be unpredictable. > > Modified: head/sys/dev/random/fortuna.c > ============================================================================== > --- head/sys/dev/random/fortuna.c Mon Apr 15 17:54:40 2019 (r346249) > +++ head/sys/dev/random/fortuna.c Mon Apr 15 18:40:36 2019 (r346250) > @@ -451,16 +451,22 @@ random_fortuna_read(uint8_t *buf, u_int bytecount) > RANDOM_RESEED_UNLOCK(); > } > > +#ifdef _KERNEL > +static bool block_seeded_status = false; > +SYSCTL_BOOL(_kern_random, OID_AUTO, block_seeded_status, CTLFLAG_RWTUN, > + &block_seeded_status, 0, > + "If non-zero, pretend Fortuna is in an unseeded state. By setting " > + "this as a tunable, boot can be tested as if the random device is " > + "unavailable."); > +#endif > + > bool > random_fortuna_seeded(void) > { > > #ifdef _KERNEL > - /* When set, act as if we are not seeded. */ > - KFAIL_POINT_CODE(DEBUG_FP, random_fortuna_seeded, { > - if (RETURN_VALUE != 0) > - fortuna_state.fs_counter = UINT128_ZERO; > - }); > + if (block_seeded_status) > + return (false); > #endif > > return (!uint128_is_zero(fortuna_state.fs_counter)); > > Modified: head/sys/dev/random/random_harvestq.c > ============================================================================== > --- head/sys/dev/random/random_harvestq.c Mon Apr 15 17:54:40 2019 (r346249) > +++ head/sys/dev/random/random_harvestq.c Mon Apr 15 18:40:36 2019 (r346250) > @@ -421,11 +421,6 @@ random_harvestq_prime(void *unused __unused) > if (keyfile != NULL) { > data = preload_fetch_addr(keyfile); > size = preload_fetch_size(keyfile); > - /* skip the first bit of the stash so others like arc4 can also have some. */ > - if (size > RANDOM_CACHED_SKIP_START) { > - data += RANDOM_CACHED_SKIP_START; > - size -= RANDOM_CACHED_SKIP_START; > - } > /* Trim the size. If the admin has a file with a funny size, we lose some. Tough. */ > size -= (size % sizeof(event.he_entropy)); > if (data != NULL && size != 0) { > > Modified: head/sys/dev/random/random_infra.c > ============================================================================== > --- head/sys/dev/random/random_infra.c Mon Apr 15 17:54:40 2019 (r346249) > +++ head/sys/dev/random/random_infra.c Mon Apr 15 18:40:36 2019 (r346250) > @@ -57,12 +57,18 @@ struct random_algorithm *p_random_alg_context = &rando > > #if defined(RANDOM_LOADABLE) > > +static void > +null_read_random(void *dummy __unused, u_int dummy2 __unused) > +{ > + panic("%s: no random module is loaded", __func__); > +} > + > struct random_readers { > int (*read_random_uio)(struct uio *, bool); > - u_int (*read_random)(void *, u_int); > + void (*read_random)(void *, u_int); > } random_reader_context = { > (int (*)(struct uio *, bool))nullop, > - (u_int (*)(void *, u_int))nullop, > + null_read_random, > }; > > struct sx randomdev_config_lock; > @@ -76,7 +82,7 @@ random_infra_sysinit(void *dummy __unused) > SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_FIRST, random_infra_sysinit, NULL); > > void > -random_infra_init(int (*p_random_read_uio)(struct uio *, bool), u_int (*p_random_read)(void *, u_int)) > +random_infra_init(int (*p_random_read_uio)(struct uio *, bool), void (*p_random_read)(void *, u_int)) > { > > RANDOM_CONFIG_X_LOCK(); > @@ -91,7 +97,7 @@ random_infra_uninit(void) > > RANDOM_CONFIG_X_LOCK(); > random_reader_context.read_random_uio = (int (*)(struct uio *, bool))nullop; > - random_reader_context.read_random = (u_int (*)(void *, u_int))nullop; > + random_reader_context.read_random = null_read_random; > RANDOM_CONFIG_X_UNLOCK(); > } > > @@ -114,15 +120,13 @@ read_random_uio(struct uio *uio, bool nonblock) > return (retval); > } > > -u_int > +void > read_random(void *buf, u_int len) > { > - u_int retval; > > RANDOM_CONFIG_S_LOCK(); > - retval = random_reader_context.read_random(buf, len); > + random_reader_context.read_random(buf, len); > RANDOM_CONFIG_S_UNLOCK(); > - return (retval); > } > > #endif /* defined(RANDOM_LOADABLE) */ > > Modified: head/sys/dev/random/randomdev.c > ============================================================================== > --- head/sys/dev/random/randomdev.c Mon Apr 15 17:54:40 2019 (r346249) > +++ head/sys/dev/random/randomdev.c Mon Apr 15 18:40:36 2019 (r346250) > @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); > #define READ_RANDOM_UIO _read_random_uio > #define READ_RANDOM _read_random > static int READ_RANDOM_UIO(struct uio *, bool); > -static u_int READ_RANDOM(void *, u_int); > +static void READ_RANDOM(void *, u_int); > #else > #define READ_RANDOM_UIO read_random_uio > #define READ_RANDOM read_random > @@ -124,11 +124,53 @@ randomdev_read(struct cdev *dev __unused, struct uio * > return (READ_RANDOM_UIO(uio, (flags & O_NONBLOCK) != 0)); > } > > +/* > + * If the random device is not seeded, blocks until it is seeded. > + * > + * Returns zero when the random device is seeded. > + * > + * If the 'interruptible' parameter is true, and the device is unseeded, this > + * routine may be interrupted. If interrupted, it will return either ERESTART > + * or EINTR. > + */ > +#define SEEDWAIT_INTERRUPTIBLE true > +#define SEEDWAIT_UNINTERRUPTIBLE false > +static int > +randomdev_wait_until_seeded(bool interruptible) > +{ > + int error, spamcount, slpflags; > + > + slpflags = interruptible ? PCATCH : 0; > + > + error = 0; > + spamcount = 0; > + while (!p_random_alg_context->ra_seeded()) { > + /* keep tapping away at the pre-read until we seed/unblock. */ > + p_random_alg_context->ra_pre_read(); > + /* Only bother the console every 10 seconds or so */ > + if (spamcount == 0) > + printf("random: %s unblock wait\n", __func__); > + spamcount = (spamcount + 1) % 100; > + error = tsleep(&random_alg_context, slpflags, "randseed", > + hz / 10); > + if (error == ERESTART || error == EINTR) { > + KASSERT(interruptible, > + ("unexpected wake of non-interruptible sleep")); > + break; > + } > + /* Squash tsleep timeout condition */ > + if (error == EWOULDBLOCK) > + error = 0; > + KASSERT(error == 0, ("unexpected tsleep error %d", error)); > + } > + return (error); > +} > + > int > READ_RANDOM_UIO(struct uio *uio, bool nonblock) > { > uint8_t *random_buf; > - int error, spamcount; > + int error; > ssize_t read_len, total_read, c; > /* 16 MiB takes about 0.08 s CPU time on my 2017 AMD Zen CPU */ > #define SIGCHK_PERIOD (16 * 1024 * 1024) > @@ -140,26 +182,13 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) > random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); > p_random_alg_context->ra_pre_read(); > error = 0; > - spamcount = 0; > /* (Un)Blocking logic */ > - while (!p_random_alg_context->ra_seeded()) { > - if (nonblock) { > + if (!p_random_alg_context->ra_seeded()) { > + if (nonblock) > error = EWOULDBLOCK; > - break; > - } > - /* keep tapping away at the pre-read until we seed/unblock. */ > - p_random_alg_context->ra_pre_read(); > - /* Only bother the console every 10 seconds or so */ > - if (spamcount == 0) > - printf("random: %s unblock wait\n", __func__); > - spamcount = (spamcount + 1)%100; > - error = tsleep(&random_alg_context, PCATCH, "randseed", hz/10); > - if (error == ERESTART || error == EINTR) > - break; > - /* Squash tsleep timeout condition */ > - if (error == EWOULDBLOCK) > - error = 0; > - KASSERT(error == 0, ("unexpected tsleep error %d", error)); > + else > + error = randomdev_wait_until_seeded( > + SEEDWAIT_INTERRUPTIBLE); > } > if (error == 0) { > read_rate_increment((uio->uio_resid + sizeof(uint32_t))/sizeof(uint32_t)); > @@ -210,30 +239,36 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) > * It cannot assumed that random_buf is a multiple of > * RANDOM_BLOCKSIZE bytes. > */ > -u_int > +void > READ_RANDOM(void *random_buf, u_int len) > { > - u_int read_len; > - uint8_t local_buf[len + RANDOM_BLOCKSIZE]; > + u_int read_directly_len; > > KASSERT(random_buf != NULL, ("No suitable random buffer in %s", __func__)); > p_random_alg_context->ra_pre_read(); > - /* (Un)Blocking logic; if not seeded, return nothing. */ > - if (p_random_alg_context->ra_seeded()) { > - read_rate_increment((len + sizeof(uint32_t))/sizeof(uint32_t)); > - if (len > 0) { > - /* > - * Belt-and-braces. > - * Round up the read length to a crypto block size multiple, > - * which is what the underlying generator is expecting. > - */ > - read_len = roundup(len, RANDOM_BLOCKSIZE); > - p_random_alg_context->ra_read(local_buf, read_len); > - memcpy(random_buf, local_buf, len); > - } > - } else > - len = 0; > - return (len); > + /* (Un)Blocking logic */ > + if (!p_random_alg_context->ra_seeded()) > + (void)randomdev_wait_until_seeded(SEEDWAIT_UNINTERRUPTIBLE); > + read_rate_increment(roundup2(len, sizeof(uint32_t))); > + if (len == 0) > + return; > + /* > + * The underlying generator expects multiples of > + * RANDOM_BLOCKSIZE. > + */ > + read_directly_len = rounddown(len, RANDOM_BLOCKSIZE); > + if (read_directly_len > 0) > + p_random_alg_context->ra_read(random_buf, read_directly_len); > + if (read_directly_len < len) { > + uint8_t remainder_buf[RANDOM_BLOCKSIZE]; > + > + p_random_alg_context->ra_read(remainder_buf, > + sizeof(remainder_buf)); > + memcpy((char *)random_buf + read_directly_len, remainder_buf, > + len - read_directly_len); > + > + explicit_bzero(remainder_buf, sizeof(remainder_buf)); > + } > } > > static __inline void > > Modified: head/sys/dev/random/randomdev.h > ============================================================================== > --- head/sys/dev/random/randomdev.h Mon Apr 15 17:54:40 2019 (r346249) > +++ head/sys/dev/random/randomdev.h Mon Apr 15 18:40:36 2019 (r346250) > @@ -118,7 +118,7 @@ extern struct sx randomdev_config_lock; > #define RANDOM_CONFIG_S_LOCK(x) sx_slock(&randomdev_config_lock) > #define RANDOM_CONFIG_S_UNLOCK(x) sx_sunlock(&randomdev_config_lock) > #define RANDOM_CONFIG_DEINIT_LOCK(x) sx_destroy(&randomdev_config_lock) > -void random_infra_init(int (*)(struct uio *, bool), u_int (*)(void *, u_int)); > +void random_infra_init(int (*)(struct uio *, bool), void (*)(void *, u_int)); > void random_infra_uninit(void); > #endif > > > Modified: head/sys/kern/kern_mib.c > ============================================================================== > --- head/sys/kern/kern_mib.c Mon Apr 15 17:54:40 2019 (r346249) > +++ head/sys/kern/kern_mib.c Mon Apr 15 18:40:36 2019 (r346250) > @@ -159,15 +159,8 @@ sysctl_kern_arnd(SYSCTL_HANDLER_ARGS) > char buf[256]; > size_t len; > > - /*- > - * This is one of the very few legitimate uses of read_random(9). > - * Use of arc4random(9) is not recommended as that will ignore > - * an unsafe (i.e. unseeded) random(4). > - * > - * If random(4) is not seeded, then this returns 0, so the > - * sysctl will return a zero-length buffer. > - */ > - len = read_random(buf, MIN(req->oldlen, sizeof(buf))); > + len = MIN(req->oldlen, sizeof(buf)); > + read_random(buf, len); > return (SYSCTL_OUT(req, buf, len)); > } > > > Modified: head/sys/libkern/arc4random.c > ============================================================================== > --- head/sys/libkern/arc4random.c Mon Apr 15 17:54:40 2019 (r346249) > +++ head/sys/libkern/arc4random.c Mon Apr 15 18:40:36 2019 (r346250) > @@ -56,7 +56,6 @@ MALLOC_DEFINE(M_CHACHA20RANDOM, "chacha20random", "cha > struct chacha20_s { > struct mtx mtx; > int numbytes; > - int first_time_done; > time_t t_reseed; > u_int8_t m_buffer[CHACHA20_BUFFER_SIZE]; > struct chacha_ctx ctx; > @@ -73,35 +72,17 @@ static struct chacha20_s *chacha20inst = NULL; > * Mix up the current context. > */ > static void > -chacha20_randomstir(struct chacha20_s* chacha20) > +chacha20_randomstir(struct chacha20_s *chacha20) > { > struct timeval tv_now; > - size_t n, size; > - u_int8_t key[CHACHA20_KEYBYTES], *data; > - caddr_t keyfile; > + u_int8_t key[CHACHA20_KEYBYTES]; > > /* > - * This is making the best of what may be an insecure > - * Situation. If the loader(8) did not have an entropy > - * stash from the previous shutdown to load, then we will > - * be improperly seeded. The answer is to make sure there > - * is an entropy stash at shutdown time. > + * If the loader(8) did not have an entropy stash from the previous > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Tue Apr 16 15:41:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E1F1576121; Tue, 16 Apr 2019 15:41:46 +0000 (UTC) (envelope-from bde@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 75AE16B208; Tue, 16 Apr 2019 15:41:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EEF421B06; Tue, 16 Apr 2019 15:41:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GFfku7075690; Tue, 16 Apr 2019 15:41:46 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GFfksB075689; Tue, 16 Apr 2019 15:41:46 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904161541.x3GFfksB075689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 16 Apr 2019 15:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346279 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75AE16B208 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 15:41:47 -0000 Author: bde Date: Tue Apr 16 15:41:45 2019 New Revision: 346279 URL: https://svnweb.freebsd.org/changeset/base/346279 Log: Oops, r346278 committed a test version with the change annulled. Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Tue Apr 16 15:31:23 2019 (r346278) +++ head/lib/libvgl/main.c Tue Apr 16 15:41:45 2019 (r346279) @@ -274,7 +274,7 @@ VGLInit(int mode) * be too slow, and malloc() may fail). Restrict ourselves similarly to * get the same efficiency and bugs for all kernels. */ - if (0 && VGLModeInfo.vi_mode >= M_VESA_BASE) + if (VGLModeInfo.vi_mode >= M_VESA_BASE) VGLBufSize = 2*VGLAdpInfo.va_line_width*VGLModeInfo.vi_height* VGLModeInfo.vi_planes; VGLBuf = malloc(VGLBufSize); From owner-svn-src-head@freebsd.org Tue Apr 16 15:47:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31C6115763CC for ; Tue, 16 Apr 2019 15:47:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE4266B5B5 for ; Tue, 16 Apr 2019 15:47:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72f.google.com with SMTP id g1so12435309qki.5 for ; Tue, 16 Apr 2019 08:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yXo/n7JM9UYlXCXIK/ds0mxRC2XakamReHHMR9RM274=; b=vRmYeoQRc0NO1PNevhzTA9YkqpVQwLe25oTuLqeAfBJ90arUZi5EERy/ApxusgWnL3 TAd56gACc1iFhLPhKb7DILPNDMeSoMNnujGWfURSqRRTc7gpk4md+DoIlGjiWprvZYSO SB4o3FkIt6PdmLvJgv0LS1xjyWCALAYisjYQCgGum/qynG2Nly8mb1REW6Ys6O4ic/KE vmcvcryvrm1q/4frrSLLpLlUGDz++JBCkwIG8EZUI1b09g8XuyThG/nhCQ6sTQUV3U4o WLc/gMAnm8DxnummPojKtDdC6MCTa4SWps2ttqsSPZsZkrAWwuSG8zJB1AajQBQY3Xq/ igtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yXo/n7JM9UYlXCXIK/ds0mxRC2XakamReHHMR9RM274=; b=Ix+NqReXHSaInXB67kiocoGoTU8oqR2hlgD6Fhv09PSmEgc7PM7LfUoa7kr/RL5S9G OJVQhroO0e01lCShioQwoGpz5OfmyUjwyGJCh4rRt6FawctB16T1sRhDB0fyYV4JL10C 9TjMSQc2bNhKZVmi66RzHTBn06jlCc2a4MqTGVGm/GO3mXks1drM4RJL8Uw68jOuFOV+ uNdd5vYqy5C3eblJaCwhmieqDU4Z1hPSLY3OujurA1ZC9s8Y3+V2g8fE5iGmA/06rO3f cdbppSayJLmW+sRCqmNUwMxp43EfVnwv8ZdUemona35PANa82kfdvvAiOeE9YBQqFiv5 N6OQ== X-Gm-Message-State: APjAAAXF+9wRdq0ObL29o3xRqr5dyiniqQuSzyyY7wle12UYLk9wmvfg +cKkrSRB5b0ztef4fXCdys7Tqv5TlVOHbqRUq0wL9g== X-Google-Smtp-Source: APXvYqzGpZ8VeJsuGTs8DMlhfPfCWm0kr2Mom1WqsRTgunet+R8zSofQCsZnB73Fcch9S7nIk31hTKw4FU2kzNSdVdM= X-Received: by 2002:a37:9a54:: with SMTP id c81mr62693242qke.113.1555429638007; Tue, 16 Apr 2019 08:47:18 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> <310a420ee0b9e12249979d89dc4fa0d4cac5a8dc.camel@freebsd.org> In-Reply-To: <310a420ee0b9e12249979d89dc4fa0d4cac5a8dc.camel@freebsd.org> From: Warner Losh Date: Tue, 16 Apr 2019 09:47:07 -0600 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Ian Lepore Cc: Emmanuel Vadot , "Conrad E. Meyer" , Justin Hibbits , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: BE4266B5B5 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.972,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Tue, 16 Apr 2019 15:47:19 -0000 On Tue, Apr 16, 2019 at 9:16 AM Ian Lepore wrote: > On Tue, 2019-04-16 at 07:18 -0600, Warner Losh wrote: > > On Tue, Apr 16, 2019, 7:04 AM Emmanuel Vadot > > wrote: > > > > > On Mon, 15 Apr 2019 17:54:56 -0700 > > > Conrad Meyer wrote: > > > > > > > On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer > > > > wrote: > > > > > E.g., the CI infrastructure for > > > > > Riscv/Arm is/was generating minimal filesystem images and not > > > > > populating /boot/entropy. > > > > > > > > I should add, I say "is/was" because I have a PR out which may > > > > address > > > > the problem: https://github.com/freebsd/freebsd-ci/pull/31 > > > > > > > > Best, > > > > Conrad > > > > > > It's not only CI, all release images (memstick, iso) don't have > > > a /boot/entropy. > > > Also all arm/arm64 image don't have this file too. > > > If /boot/entropy is needed and isn't present loader(8) should > > > gather > > > some entropy and pass this to the kernel for the first boot. > > > > > > > Maybe we need to bootstrap the entropy file as part of buildworld. > > I'm not > > sure if the loader can find enough... > > > > > Isn't a file full of data which is distributed in identical form to > everyone the exact opposite of entropy? > It's just to bootstrap entropy for installs. The CI stuff doesn't matter if that's the same since the CI images aren't exposed to the internet in any way that would make it matter. The normal install would have the same seeds of entropy, but diverge from there fairly quickly. The stuff that's used early in the install is the don't care sort of things that won't matter in the installer (which then creates it's own entropy that's different for every install). Warner From owner-svn-src-head@freebsd.org Tue Apr 16 15:48:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9184F1576447; Tue, 16 Apr 2019 15:48:29 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E0F86B70D; Tue, 16 Apr 2019 15:48:29 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f182.google.com with SMTP id y10so33295445itc.1; Tue, 16 Apr 2019 08:48:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=c8OSmZizMKSpedgdZ2MjjS1Ff40fGdSwA9DCUazOA34=; b=rbXK5RYvAU9hjOJ4qKEsqB9DYbMQCh3lCjPVSvSdNUKfUgHGk9cfhAzv4469pBY0/m uR970pPtt7/lrPcuNRtMin8yx3U59fJRdjEcKukEUeJWNDMpd9nmXerzp8F1PSHhKFPD B8eaTlWYJrz3HJ6+8tDgB2B0WxQy0fASjAfL0I9Vtq0FuYRoeqYrliEPGJkbyKcDb8/i pRx0pmTR2WOiCKV9TMuBL8yiRAx640RmUvoxyXsDY19AFxZPStdds8Ky1PKB6FRYRQGp CXTB1WK54l79GDZtSPKYUE5jumyH4+njzZgodQyDvJaoGmsfmURNGXuhM6Umsbx1ow8O cSqw== X-Gm-Message-State: APjAAAUkN37EIF5KARwgi7MZmEQClxoMAt722fRC+pDIjM1CVEDSSkeY /aA3EeHb0AYOVJhEBy5dhr4Ol6VS X-Google-Smtp-Source: APXvYqzqpB/jGbvcszFPvJGLtlF/6otgk5kUsD1CglBI9gfl2i7pFUvutu+lnln5i8Q1aKNn7iqW7g== X-Received: by 2002:a24:2e06:: with SMTP id i6mr29810586ita.18.1555429707864; Tue, 16 Apr 2019 08:48:27 -0700 (PDT) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com. [209.85.166.169]) by smtp.gmail.com with ESMTPSA id 25sm18245657iog.83.2019.04.16.08.48.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 08:48:27 -0700 (PDT) Received: by mail-it1-f169.google.com with SMTP id 139so33276160ita.4; Tue, 16 Apr 2019 08:48:27 -0700 (PDT) X-Received: by 2002:a05:660c:111:: with SMTP id w17mr30475578itj.62.1555429707511; Tue, 16 Apr 2019 08:48:27 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416153816.GA20965@bsdpad.com> In-Reply-To: <20190416153816.GA20965@bsdpad.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 08:48:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Ruslan Bukin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1E0F86B70D 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.987,0]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 15:48:29 -0000 Hi Ruslan, On Tue, Apr 16, 2019 at 8:38 AM Ruslan Bukin wrote: > > Hi I just got this: > > ... > _sleep() at random_harvest_deregister_source+0x132 > random_harvest_deregister_source() at read_random+0xc4 > read_random() at vn_fsync_buf+0x594 > vn_fsync_buf() at arc4rand+0xd4 > arc4rand() at sched_tdname+0x4c > sched_tdname() at mi_startup+0x20c > mi_startup() at 0xffffffc0000001a6 > KDB: enter: panic The stack is clearly bogus or missing some frames; can you attach GDB on this system (or an emulator) and get a full stack? The step(s) I'm missing are mi_startup -> sched_tdname, and sched_tdname -> arc4rand(). What's consuming random during early boot on riscv? (The vn_fsync_buf frame is also confusing and probably incorrect? A real stack would be helpful.) Maybe it's just __stack_chk_init, given mi_startup, like the other reproductions. I will need to take a step back from email to address that.) > We don't have loader(8) support for RISC-V and we don't have any hardware with random number generators yet. Most of our fpga/hardware has no way to have rootfs at all (we use mdroot). Is it possible to inject entropy into the mdroot? If not, it seems like anything that consumes random during early boot on riscv must be disabled. > We use BBL bootloader to boot freebsd. BBL embeds freebsd kernel to the BBL binary on a compile time (similar way how we embed mdroot to kernel). Once BBL initialized itself it jumps to the pre-defined address of payload which is freebsd kernel. > > So I'm pondering what is our current option, i.e. how to feed entropy in this case ? Can a running system rebuild the mdroot or BBL? Or do they reside on RO flash of some kind? If so, it would be possible to rewrite the BBL or mdroot with entropy injected for the next boot, I think. Otherwise, the straightforward solution is to simply disable anything that attempts to consume random early in boot on such devices with no hardware entropy source and no early filesystem access. Anything that is tripping on this was silently feeding itself with predictable, non-random data prior to this change. Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 15:50:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1589F15764F0 for ; Tue, 16 Apr 2019 15:50:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A972C6B876 for ; Tue, 16 Apr 2019 15:50:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x736.google.com with SMTP id x18so239324qkf.13 for ; Tue, 16 Apr 2019 08:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0g0RjS34/3cH4j/R9MxG0zJb0uG7JrC/U5HNj3Xk6g4=; b=yp7SZWxwvmWm9XApYkp2AswlIdDmAQZzoZvCwynMTf/GTP2qt0IJERcVJdNfmKYIhV FxhlLXrgpzP/0JPhxoD9jAlp5GvoTjVHl4a13fRAPWcByh/PrPnHnnydwpqgv5d4qJcH XB9NEPDyRJzDvZlLpDfSG9A80y0u78zSz2YJ8n90uHncPFbLzwJIbGa38ZGlUCCV4E/w X59QN38C0XD/u+T58qQ5iyGrq8BPwn1d5Udiuzf7FwYC+WaxNqvczy1BqOn95pm9fElq 9QGwmmeRLAanV/MTAJ5eZdQLNaJre9Jom7iC7FQXwWSuELgWHB7oUyNVDpv0oXIN7rqV +K4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0g0RjS34/3cH4j/R9MxG0zJb0uG7JrC/U5HNj3Xk6g4=; b=bY197APZKnbkEiBEphvCQB2uE6O1CQ6UjWntS/zzDvVYYvpmuRoqnHzfmGoW7AdYn2 +kP1+Qbcl37+4NURwFCESMJjnaot5vLqoGiGjec4Jw1VTB/uEmFRKhW5l5VP7PzDrdhY CZGxjZsaxljJQV56Liqo0dplGLjj5yHWjWLpDC470mm7DDHatDPrZiR9eHFkUlyw2DL7 zLvN8BNr5/YZNHYiFNMqVPMsYhg4OzJzQXeMdApMv1mkzaR5bAOYqT2q2wY9q+UWhtdC 94xJeMFCc2bwpJRys4NKhDuABpaBizLPWBa7TvudKxNwe19cOf7r9WvyDdLVa9KIkTBC QqaA== X-Gm-Message-State: APjAAAUIM4avDFrUxRxUvtYyDegWJFq5K7WoW6UTV1vIb91JLxvtIuZP t7ktkIoRZSChln0Ym68BR/9mV9rHH9wVzsjvxbxnUQ== X-Google-Smtp-Source: APXvYqxtkg52BRk3b62Q+e1D6syBnLgp4oySSIEilBjJGlOsLC9gJWXvIhqCWv7cTomDVjzby9lZg2nZvSl41/Amk5E= X-Received: by 2002:a37:9e0d:: with SMTP id h13mr63733955qke.135.1555429809011; Tue, 16 Apr 2019 08:50:09 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416092402.4288bc90@titan.knownspace> In-Reply-To: From: Warner Losh Date: Tue, 16 Apr 2019 09:49:58 -0600 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: "Conrad E. Meyer" Cc: Justin Hibbits , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: A972C6B876 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.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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: Tue, 16 Apr 2019 15:50:10 -0000 On Tue, Apr 16, 2019 at 9:27 AM Conrad Meyer wrote: > On Tue, Apr 16, 2019 at 7:24 AM Justin Hibbits > wrote: > > > > Hi Conrad, > > ... > > [Power] does use bsdinstall to install. How is entropy loaded at > startup, > > which causes the problem noted in github? > > There are a couple very early load sources. loader(8) will load > early-boot entropy from /boot/entropy and pass it to the kernel as a > fake module (entropy_cache_load in loader.conf(5)), similar to > cpu_microcode early load. > > The fallback option is random(4) itself groping into the filesystem > during early auto-conf (SI_SUB_RANDOM:SI_ORDER_FOURTH, IIRC) to access > /boot/entropy directly. > SI_SUB_RANDOM is too early. It's at 0x2160000, while SI_SUB_ROOT_CONF doesn't happen until 0xb000000. > > If it's loaded before > > filesystems get mounted, that could be a problem for us, because /boot > > is on a different filesystem (msdosfs, to be read by petitboot). > > Petitboot also does not have a way to preload modules, so all we have > > at startup, until spawning init, is the kernel. > > Yes, that seems potentially problematic. Can the Power kernel access > the non-msdosfs root filesystem? Let's follow-up offline about > PPC-specific early entropy seeding. I would much prefer we figure out > a way to provide early entropy to Power than disabling or crippling > every early random consumer on the arch. Do you know what the Linux > folks do? > > On Power with darn, we could probably just spin in SI_ORDER_FOURTH > until we have enough darn output to seed random. Similar for x86 CI > images, I guess; though they do not have the loader problem, some > people have non-bsdinstall installation methods. > They do have the loader problem because many means to generate an image don't generate /boot/entropy. Warner From owner-svn-src-head@freebsd.org Tue Apr 16 15:51:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B15FA15766E0; Tue, 16 Apr 2019 15:51:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 456F16BADF; Tue, 16 Apr 2019 15:51:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id b6so18066666iog.0; Tue, 16 Apr 2019 08:51:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=CDAhlAC6bg+9IQ6xROzW8RwyDwhnObenLqsKLNx7A0o=; b=CkIkxMo+IR+n77YgzC47oAjwEjbzegJ4/bzgIsxWrx15tIqFowkNxgTwJ5zP8t3pWN 8zjDNHWRctncjogLbdVg8eZxygChCdbmjsaSu8m8n86ibKTrboeifd0NsbYwzD3G7ycs qIbHqPwLxPFQKrDTMTIoftIfDanmMmHSTD6YbpzL1/wjufYWfry7+PUpM1uiJmmZcIkb 1q48GDrupLd1PajXb+GEGuBTQia4u8uwHyXJrcA7RCSgWcWpBQMxP8c0im9ISS5LtjZV GM+ZCj5mAzwr7CNvQmFH5LschHp4TjDw1p2HTC4NJIdmzA+jP5UPHXtuHlo0hqWzsxgq NRvA== X-Gm-Message-State: APjAAAXUkYpjYXQ080N9xapMgyW1EcQlQ2ngTehHIbMh8cn9QVBVaU23 goeasNVIAGnB2jyiZGap9zR8D3VU X-Google-Smtp-Source: APXvYqwNF17r7+LVev4M9Het7slQFHv/hbkG0WgQk5i3p0u8eKgag9F8NeNocSyQONT4/rjORgTF6g== X-Received: by 2002:a5e:8706:: with SMTP id y6mr56655379ioj.160.1555429877047; Tue, 16 Apr 2019 08:51:17 -0700 (PDT) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com. [209.85.166.54]) by smtp.gmail.com with ESMTPSA id e11sm18586442iog.79.2019.04.16.08.51.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 08:51:16 -0700 (PDT) Received: by mail-io1-f54.google.com with SMTP id x7so18041649ioh.4; Tue, 16 Apr 2019 08:51:16 -0700 (PDT) X-Received: by 2002:a6b:8b90:: with SMTP id n138mr8526677iod.75.1555429876655; Tue, 16 Apr 2019 08:51:16 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> <310a420ee0b9e12249979d89dc4fa0d4cac5a8dc.camel@freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 08:51:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 456F16BADF 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.987,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 15:51:19 -0000 Hi Warner, On Tue, Apr 16, 2019 at 8:47 AM Warner Losh wrote: > On Tue, Apr 16, 2019 at 9:16 AM Ian Lepore wrote: >> Isn't a file full of data which is distributed in identical form to >> everyone the exact opposite of entropy? Ian has the right idea. > It's just to bootstrap entropy for installs. The CI stuff doesn't matter = if that's the same since the CI images aren't exposed to the internet in an= y way that would make it matter. The normal install would have the same see= ds of entropy, but diverge from there fairly quickly. The stuff that's used= early in the install is the don't care sort of things that won't matter in= the installer (which then creates it's own entropy that's different for ev= ery install). I agree that it would be safe, although potentially misleading and potentially dangerous, to create a fake entropy file for the installer images. We need to be careful *not* to embed such files in .img files which are installed by 'dd' directly to a disk or flash or VM, for example. It would be catastrophic to distribute the same entropy file to all FreeBSD AWS images. Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 15:52:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E38F15767F4; Tue, 16 Apr 2019 15:52:05 +0000 (UTC) (envelope-from bde@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 B68CB6BD76; Tue, 16 Apr 2019 15:52:04 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 931EC21CC3; Tue, 16 Apr 2019 15:52:04 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GFq4gO080991; Tue, 16 Apr 2019 15:52:04 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GFq4Bk080990; Tue, 16 Apr 2019 15:52:04 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904161552.x3GFq4Bk080990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 16 Apr 2019 15:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346280 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B68CB6BD76 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 15:52:05 -0000 Author: bde Date: Tue Apr 16 15:52:04 2019 New Revision: 346280 URL: https://svnweb.freebsd.org/changeset/base/346280 Log: Sigh, r346279 was also a test version with the reduced size doubled (so it was actually double the full size in current kernels where the reduction is null, so overran the mmapped() buffer). Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Tue Apr 16 15:41:45 2019 (r346279) +++ head/lib/libvgl/main.c Tue Apr 16 15:52:04 2019 (r346280) @@ -275,7 +275,7 @@ VGLInit(int mode) * get the same efficiency and bugs for all kernels. */ if (VGLModeInfo.vi_mode >= M_VESA_BASE) - VGLBufSize = 2*VGLAdpInfo.va_line_width*VGLModeInfo.vi_height* + VGLBufSize = VGLAdpInfo.va_line_width*VGLModeInfo.vi_height* VGLModeInfo.vi_planes; VGLBuf = malloc(VGLBufSize); if (VGLBuf == NULL) { From owner-svn-src-head@freebsd.org Tue Apr 16 15:54:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 187B41576A4D; Tue, 16 Apr 2019 15:54:18 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 7CD926C08F; Tue, 16 Apr 2019 15:54:17 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3GFsCGU095443; Tue, 16 Apr 2019 08:54:12 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3GFsCZF095442; Tue, 16 Apr 2019 08:54:12 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904161554.x3GFsCZF095442@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys In-Reply-To: To: Warner Losh Date: Tue, 16 Apr 2019 08:54:12 -0700 (PDT) CC: Ian Lepore , Emmanuel Vadot , "Conrad E. Meyer" , Justin Hibbits , src-committers , svn-src-all , svn-src-head 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: 7CD926C08F 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.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, 16 Apr 2019 15:54:18 -0000 > On Tue, Apr 16, 2019 at 9:16 AM Ian Lepore wrote: > > > On Tue, 2019-04-16 at 07:18 -0600, Warner Losh wrote: > > > On Tue, Apr 16, 2019, 7:04 AM Emmanuel Vadot > > > wrote: > > > > > > > On Mon, 15 Apr 2019 17:54:56 -0700 > > > > Conrad Meyer wrote: > > > > > > > > > On Mon, Apr 15, 2019 at 5:53 PM Conrad Meyer > > > > > wrote: > > > > > > E.g., the CI infrastructure for > > > > > > Riscv/Arm is/was generating minimal filesystem images and not > > > > > > populating /boot/entropy. > > > > > > > > > > I should add, I say "is/was" because I have a PR out which may > > > > > address > > > > > the problem: https://github.com/freebsd/freebsd-ci/pull/31 > > > > > > > > > > Best, > > > > > Conrad > > > > > > > > It's not only CI, all release images (memstick, iso) don't have > > > > a /boot/entropy. > > > > Also all arm/arm64 image don't have this file too. > > > > If /boot/entropy is needed and isn't present loader(8) should > > > > gather > > > > some entropy and pass this to the kernel for the first boot. > > > > > > > > > > Maybe we need to bootstrap the entropy file as part of buildworld. > > > I'm not > > > sure if the loader can find enough... > > > > > > > > Isn't a file full of data which is distributed in identical form to > > everyone the exact opposite of entropy? > > > > It's just to bootstrap entropy for installs. The CI stuff doesn't matter if > that's the same since the CI images aren't exposed to the internet in any > way that would make it matter. Incorrect, the CI artifacts are publically avaliable. I infact have Makefiles that take any given CI build artifact set and create a VM from it, I use this for bisecting failures and other testing. > The normal install would have the same seeds > of entropy, but diverge from there fairly quickly. The stuff that's used > early in the install is the don't care sort of things that won't matter in > the installer (which then creates it's own entropy that's different for > every install). I have concerns here, if I use a distribution with a canned entropy in it to make a file system that is snapshotted, aka frozen in time, that its entropy would be repeatable. This file system is never run through any installer, it is, I believe, how most of the Cloud images are created. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Apr 16 15:56:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDB3C1576AFF; Tue, 16 Apr 2019 15:56:32 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 7A8786C24B; Tue, 16 Apr 2019 15:56:32 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3GFuT7K095472; Tue, 16 Apr 2019 08:56:29 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3GFuTvO095471; Tue, 16 Apr 2019 08:56:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904161556.x3GFuTvO095471@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys In-Reply-To: To: cem@freebsd.org Date: Tue, 16 Apr 2019 08:56:29 -0700 (PDT) CC: Warner Losh , src-committers , svn-src-all , svn-src-head 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: 7A8786C24B 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.972,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: Tue, 16 Apr 2019 15:56:33 -0000 [ Charset UTF-8 unsupported, converting... ] > Hi Warner, > > On Tue, Apr 16, 2019 at 8:47 AM Warner Losh wrote: > > On Tue, Apr 16, 2019 at 9:16 AM Ian Lepore wrote: > >> Isn't a file full of data which is distributed in identical form to > >> everyone the exact opposite of entropy? > > Ian has the right idea. > > > It's just to bootstrap entropy for installs. The CI stuff doesn't matter if that's the same since the CI images aren't exposed to the internet in any way that would make it matter. The normal install would have the same seeds of entropy, but diverge from there fairly quickly. The stuff that's used early in the install is the don't care sort of things that won't matter in the installer (which then creates it's own entropy that's different for every install). > > I agree that it would be safe, although potentially misleading and > potentially dangerous, to create a fake entropy file for the installer > images. We need to be careful *not* to embed such files in .img files > which are installed by 'dd' directly to a disk or flash or VM, for > example. It would be catastrophic to distribute the same entropy file > to all FreeBSD AWS images. Thank you Conrad, I'll bow out of any discussion now, you clearly have the same concern I do. > Best, > Conrad -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Apr 16 16:11:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F6631576F99; Tue, 16 Apr 2019 16:11:09 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::609]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72E356C922; Tue, 16 Apr 2019 16:11:07 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback13o.mail.yandex.net (mxback13o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::64]) by forward106o.mail.yandex.net (Yandex) with ESMTP id D8BA15060E5F; Tue, 16 Apr 2019 19:11:01 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback13o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nq9NGzigDT-B1xOLfxd; Tue, 16 Apr 2019 19:11:01 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1555431061; bh=CayBpiN/tghrGu3DSIZX/HpfzZhpn2zJqbFzmn601L0=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=Wvq8zPido0O/W8eoJG+9PVurLzvCewchCzG4Z6d1nVTQim8tHNW6vbMv3iFPipLJH wGVvJgx/739GHvumbMOxOMCvceGQtlItpMPxBGIXSmqy8YU/C8VqauZJ8vjXdoXUc0 d9vXOyYEBCiE4uXQ39+ldHG6dXpna7bmdOauHk5w= Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id zC5C4JZGVt-B0oe5SxC; Tue, 16 Apr 2019 19:11:00 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: slavash@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, slavash@mellanox.com References: <201812051425.wB5EP38T004562@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <2a683ce4-5aec-8a15-592d-7193ee470d42@yandex.ru> Date: Tue, 16 Apr 2019 19:09:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZnDdBF2SYJtWFjqCLirAfbXbL0KINRfBs" X-Rspamd-Queue-Id: 72E356C922 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=Wvq8zPid; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of bu7cher@yandex.ru designates 2a02:6b8:0:1a2d::609 as permitted sender) smtp.mailfrom=bu7cher@yandex.ru X-Spamd-Result: default: False [-4.92 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1a2d::/64]; FREEMAIL_FROM(0.00)[yandex.ru]; HAS_ATTACHMENT(0.00)[]; TO_DN_NONE(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx.yandex.ru]; DKIM_TRACE(0.00)[yandex.ru:+]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; RCVD_IN_DNSWL_LOW(-0.10)[9.0.6.0.0.0.0.0.0.0.0.0.0.0.0.0.d.2.a.1.0.0.0.0.8.b.6.0.2.0.a.2.list.dnswl.org : 127.0.5.1]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yandex.ru.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.29)[0.292,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.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: Tue, 16 Apr 2019 16:11:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ZnDdBF2SYJtWFjqCLirAfbXbL0KINRfBs Content-Type: multipart/mixed; boundary="P54kZfA7QLkFPIgrWBUzy7s9GAxkXvcWM"; protected-headers="v1" From: "Andrey V. Elsukov" To: slavash@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, slavash@mellanox.com Message-ID: <2a683ce4-5aec-8a15-592d-7193ee470d42@yandex.ru> Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en References: <201812051425.wB5EP38T004562@repo.freebsd.org> In-Reply-To: --P54kZfA7QLkFPIgrWBUzy7s9GAxkXvcWM Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 16.04.2019 18:26, Slava Shwartsman wrote: > Thanks for letting us know about this regression. > I would like to try to reproduce this issue in house. >=20 > Can you please share the exact steps to reproduce it? > - Can I reproduce the issue with B2B setup? > - What is the route command you used to make the route between the VLAN= s? > - What app are you using to generate the traffic? >=20 I think this can be reproduced on simple router, where single mce(4) interface is used as parent for several vlan(4) interfaces. E.g. [host1] vlan100 <--> mce0.100 [gateway] mce0.200 <--> vlan200 [host2] 10.0.0.1 10.0.0.254 192.168.0.254 192.168.0.1 gateway: sysctl net.inet.ip.forwarding=3D1 host1: route add 192.168.0.0/24 10.0.0.254 host2: route add 10.0.0.0/24 192.168.0.254 ping 10.0.0.1 I.e. you need to make setup, where ingress and egress interface is the same - mce0. --=20 WBR, Andrey V. Elsukov --P54kZfA7QLkFPIgrWBUzy7s9GAxkXvcWM-- --ZnDdBF2SYJtWFjqCLirAfbXbL0KINRfBs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAly1/lcACgkQAcXqBBDI oXrFkgf/djzppyUEiH/FG56Pr8TrF1j2AZ2J6uX4W+BgjwglqfQAr4zKi9LzUlOY oKxYX7jHXQp3WO1ETPMdh5bz1MwyPE4Kf9ybsyrFXqjl1J22t/jtst4iIqiLGOh2 Tgif07McRUkqk0CNSz0x1ti8ghnZYc+kf7uZefffdcAFZKoE0IzrMMiUwNhClAlN sPTcssiQ03A1dLiltcB6r/k3VN6Se9oGUWcOVHFeqcX0DBODcT3tYHARdkJNd9bH JBoOrCYMP1rIMexeqK7Z+s/QPIVI6jNuDIcpETSSoT+yrHt0fMZWFHOEfuLwNPcq NYBb91Xx1oNXNEKFol8T2SszhUl3gQ== =bntY -----END PGP SIGNATURE----- --ZnDdBF2SYJtWFjqCLirAfbXbL0KINRfBs-- From owner-svn-src-head@freebsd.org Tue Apr 16 16:33:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C700B1577466 for ; Tue, 16 Apr 2019 16:33:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D7F16D4A3 for ; Tue, 16 Apr 2019 16:33:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72b.google.com with SMTP id k189so12549918qkc.0 for ; Tue, 16 Apr 2019 09:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hSv5QYTgJ8vuuz6EDzVV3PinrDfGNtJFdph2p8Uo0eM=; b=ObmqjP/LBlfr2Atp7Yq7v+xk7g291tedU97zxr6BQYLGUVmUP3KSKC3BmuTZpuAEqH tFXOc3bNNLIxIevDtZF2F1uney+hbQDQdfkXe+Rw4LuAV2x9Y0QTmp00x7QlhUOJfqXe 90mBWSWONbygxh4fVhG5nDEHIJY0i2QRrwZD+v2dzbrTUT7lUwETRqpLJy1zoRuxmT77 kHwIJtqYiJqou1v6xj7LK8VGZnylME1MxeS5VnAM2rnvJbyqttxSE6/4nstSmTlOtLOQ 50TNm2JnB679eSXeGmeOjrWEszWI7BRYyZzM9q4AjVzsBUiHp0rCpCs9F+/3xLRLxTMq M4mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hSv5QYTgJ8vuuz6EDzVV3PinrDfGNtJFdph2p8Uo0eM=; b=lGW2OMQA9ymF9sBdeQ1uyBTD7NtEbkq2krzjvCgdLqN/iA++FgXF6RJfJXf6tQ70ci FROjMWR6YHDotcxlGhhVb3xe/wdbxq4ZX4nIuabM21xukQyjiBwcs2GubNE9iXZm9r+j JWyozP+XpYZMrjd1/1TdguqTKPaz7pA8JgfvhbMvyiek2wC7o4n3aTlBVqhZLDvu/CGf 7Dpl3u01hrcgKg4CSJaMRj3eR9cJOF0HF2o1pa+qLZTsJwXQ03yP2GAjIHQztWxI7uVo 1724Uh6OYt9DM6lIxo4kemTnISmbXLQBLK+SMmkTXmhtK1QTVTqYkAtzXkwSdygyh2nk w/7g== X-Gm-Message-State: APjAAAWKtXhRfb/AtFzROkMAKirYagzgTXv5PtVLUnb2exvowRtWW5ii bU6o5cagk0a7tWpM6OAYqc/AhkLCJoaF4kU1uBW3DbbR X-Google-Smtp-Source: APXvYqx1cVrE8upgVM7yL56pKGbuhDRtzRG5jMDyRrbUOVp8aeG1FsLQg7jGB9WG1hrSDgUrtJu/Gx1cvBOMqJpIJVY= X-Received: by 2002:a37:9e0d:: with SMTP id h13mr63940311qke.135.1555432386521; Tue, 16 Apr 2019 09:33:06 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> <310a420ee0b9e12249979d89dc4fa0d4cac5a8dc.camel@freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 16 Apr 2019 10:32:55 -0600 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: "Conrad E. Meyer" Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 5D7F16D4A3 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Tue, 16 Apr 2019 16:33:08 -0000 On Tue, Apr 16, 2019 at 9:51 AM Conrad Meyer wrote: > Hi Warner, > > On Tue, Apr 16, 2019 at 8:47 AM Warner Losh wrote: > > On Tue, Apr 16, 2019 at 9:16 AM Ian Lepore wrote: > >> Isn't a file full of data which is distributed in identical form to > >> everyone the exact opposite of entropy? > > Ian has the right idea. > > > It's just to bootstrap entropy for installs. The CI stuff doesn't matter > if that's the same since the CI images aren't exposed to the internet in > any way that would make it matter. The normal install would have the same > seeds of entropy, but diverge from there fairly quickly. The stuff that's > used early in the install is the don't care sort of things that won't > matter in the installer (which then creates it's own entropy that's > different for every install). > > I agree that it would be safe, although potentially misleading and > potentially dangerous, to create a fake entropy file for the installer > images. We need to be careful *not* to embed such files in .img files > which are installed by 'dd' directly to a disk or flash or VM, for > example. It would be catastrophic to distribute the same entropy file > to all FreeBSD AWS images. > In that case, we're better off having a MD routine that gets called if there's no loader-provided entropy pool. It would be responsible for generating it in a MD defined way. It would handle it or call panic() based on the requirements of the environment. This would answer the issue with embedded systems that do not have any writable store (and requiring an NV store is not even an option to require, so don't go there). It would let hardware with RNG generate something. It would let hardware without get it from wherever which may be highly specific to different scenarios or make the conscious decision not to get it at all vs panic, etc. What we can't do is just hang if the loader can't provide an entropy pool. Warner From owner-svn-src-head@freebsd.org Tue Apr 16 16:33:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30D6615774AC; Tue, 16 Apr 2019 16:33:39 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A82D86D5E3; Tue, 16 Apr 2019 16:33:38 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wm1-f67.google.com with SMTP id a184so26208825wma.2; Tue, 16 Apr 2019 09:33:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xzoyuqJjN97oi8wOmjD+bZ5jJ4Q3yms0vJMbjXOZdek=; b=PAD2i4ni29as0oEejgfsieTUMifZmnrfvl1jA87DraB6lO+pOjX+N30ZzUWnkpQKl6 GAzXVc8PgTp9QNNt+stv6nFl2dhHPby2SHVdnTLI1wyeeujj+u/QY7wkNs4dqnsNumXq Qp0CMrj3oiE24PP33PppIN4VN4GthmIRTbty9mfSiLHb1P5XOxOIRLiRwedFTQK/cXR2 K3TQ0ey1GDmip6nGCO1qdTWNyLU1mbk1cPFc+3ULndM1eiXVNohlYIxCB4aZ3onkn/Qq Jskqk7u+62RWrVoho0X0jx8lWD+tOwlBHiDUXugTA+uGsgSJCI+ry14NJDg77FtgmPR1 LWGA== X-Gm-Message-State: APjAAAUTLq8hEdUYEF0s+hTecR/q7SF7fISGkMAMj0KaBvtT4Q8Ds3+D p6hceKYKYD5pZyC6P1VC73JOnb+r X-Google-Smtp-Source: APXvYqwvGhLoK3jeAtwZQgIsjdXaqrR8XrlT5x1870igppgBbaU+xhaiPi1ZZuVlLAUegrbMwJs+uA== X-Received: by 2002:a1c:ac07:: with SMTP id v7mr2667693wme.49.1555428391734; Tue, 16 Apr 2019 08:26:31 -0700 (PDT) Received: from [10.0.0.30] (bzq-79-181-3-237.red.bezeqint.net. [79.181.3.237]) by smtp.gmail.com with ESMTPSA id g12sm62178942wrw.40.2019.04.16.08.26.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 08:26:30 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, slavash@mellanox.com References: <201812051425.wB5EP38T004562@repo.freebsd.org> From: Slava Shwartsman Message-ID: Date: Tue, 16 Apr 2019 18:26:28 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A82D86D5E3 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)[]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 16:33:39 -0000 On 16-Apr-19 17:39, Andrey V. Elsukov wrote: > On 05.12.2018 17:25, Slava Shwartsman wrote: >> Author: slavash >> Date: Wed Dec 5 14:25:03 2018 >> New Revision: 341586 >> URL: https://svnweb.freebsd.org/changeset/base/341586 >> >> Log: >> mlx5en: Implement backpressure indication. >> >> The backpressure indication is implemented using an unlimited rate type of >> mbuf send tag. When the upper layers typically the socket layer has obtained such >> a tag, it can then query the destination driver queue for the current >> amount of space available in the send queue. >> >> A single mbuf send tag may be referenced multiple times and a refcount has been added >> to the mlx5e_priv structure to track its usage. Because the send tag resides >> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >> zero until the mlx4en(4) driver is detached. The channels structure is persistant >> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >> without any need of synchronization. >> >> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >> two different tag types which end up in the driver which need to be distinguished. >> >> Submitted by: hselasky@ >> Approved by: hselasky (mentor) >> MFC after: 1 week >> Sponsored by: Mellanox Technologies >> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >> struct mlx5e_sq *sq; >> int ret; >> >> - sq = mlx5e_select_queue(ifp, mb); >> - if (unlikely(sq == NULL)) { >> -#ifdef RATELIMIT >> - /* Check for route change */ >> - if (mb->m_pkthdr.snd_tag != NULL && >> - mb->m_pkthdr.snd_tag->ifp != ifp) { >> + if (mb->m_pkthdr.snd_tag != NULL) { >> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >> + if (unlikely(sq == NULL)) { >> + /* Check for route change */ >> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >> + /* Free mbuf */ >> + m_freem(mb); >> + >> + /* >> + * Tell upper layers about route >> + * change and to re-transmit this >> + * packet: >> + */ >> + return (EAGAIN); >> + } > > Hi, > > I just discovered something strange and found that this commit is the > cause. > The test system has mlx5en 100G interface. It has two vlans: vlan500 and > vlan100. > Via vlan500 it receives some packets flows. Then it routes these packets > into vlan100. > But packets are dropped in mlx5e_xmit() with EAGAIN error code. > > # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' > dtrace: description 'fbt::ip6_output:return ' matched 1 probe > CPU ID FUNCTION:NAME > 23 54338 ip6_output:return 35 > 16 54338 ip6_output:return 35 > 21 54338 ip6_output:return 35 > 22 54338 ip6_output:return 35 > 24 54338 ip6_output:return 35 > 23 54338 ip6_output:return 35 > 14 54338 ip6_output:return 35 > ^C > > # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' > dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe > CPU ID FUNCTION:NAME > 16 69030 mlx5e_xmit:return 35 > 23 69030 mlx5e_xmit:return 35 > 26 69030 mlx5e_xmit:return 35 > 25 69030 mlx5e_xmit:return 35 > 24 69030 mlx5e_xmit:return 35 > 21 69030 mlx5e_xmit:return 35 > 26 69030 mlx5e_xmit:return 35 > ^C > > The kernel config is GENERIC. > 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty > Hi Andrey, Thanks for letting us know about this regression. I would like to try to reproduce this issue in house. Can you please share the exact steps to reproduce it? - Can I reproduce the issue with B2B setup? - What is the route command you used to make the route between the VLANs? - What app are you using to generate the traffic? Slava From owner-svn-src-head@freebsd.org Tue Apr 16 16:49:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2330115777C3; Tue, 16 Apr 2019 16:49:35 +0000 (UTC) (envelope-from gallatin@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 BA12A6DB76; Tue, 16 Apr 2019 16:49:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86F4922575; Tue, 16 Apr 2019 16:49:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GGnYpd008373; Tue, 16 Apr 2019 16:49:34 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GGnYNL008372; Tue, 16 Apr 2019 16:49:34 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201904161649.x3GGnYNL008372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 16 Apr 2019 16:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346281 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 346281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA12A6DB76 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)[-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: Tue, 16 Apr 2019 16:49:35 -0000 Author: gallatin Date: Tue Apr 16 16:49:34 2019 New Revision: 346281 URL: https://svnweb.freebsd.org/changeset/base/346281 Log: Replace cosqos with numa_domain in mbuf pkthdr The cosqos field was added nearly 6 years ago in r254804, and it is still unused by any in-tree consumers. I have a patchset that I'm working on which aligns many network resources by NUMA domain, including inps, inpcb lb group, tcp pacing, lagg output link selection, backing pages for sendfile, and more. It reduces cross-domain traffic by roughly 50% for a real web workload. This patchset relies on being able to store the numa domain in the mbuf, and grabbing the unused cosqos field for this purpose is the first step in starting to usptream it. Reviewed by: kib, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19862 Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Apr 16 15:52:04 2019 (r346280) +++ head/sys/sys/mbuf.h Tue Apr 16 16:49:34 2019 (r346281) @@ -98,6 +98,7 @@ struct mbuf; #define MLEN ((int)(MSIZE - MHSIZE)) #define MHLEN ((int)(MSIZE - MPKTHSIZE)) #define MINCLSIZE (MHLEN + 1) +#define M_NODOM 255 #ifdef _KERNEL /*- @@ -158,7 +159,7 @@ struct pkthdr { uint32_t flowid; /* packet's 4-tuple system */ uint32_t csum_flags; /* checksum and offload features */ uint16_t fibnum; /* this packet should use this fib */ - uint8_t cosqos; /* class/quality of service */ + uint8_t numa_domain; /* NUMA domain of recvd pkt */ uint8_t rsstype; /* hash type */ union { uint64_t rcv_tstmp; /* timestamp in ns */ @@ -405,33 +406,6 @@ struct mbuf { #define M_HASHTYPE_SET(m, v) ((m)->m_pkthdr.rsstype = (v)) #define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v)) #define M_HASHTYPE_ISHASH(m) (M_HASHTYPE_GET(m) & M_HASHTYPE_HASHPROP) - -/* - * COS/QOS class and quality of service tags. - * It uses DSCP code points as base. - */ -#define QOS_DSCP_CS0 0x00 -#define QOS_DSCP_DEF QOS_DSCP_CS0 -#define QOS_DSCP_CS1 0x20 -#define QOS_DSCP_AF11 0x28 -#define QOS_DSCP_AF12 0x30 -#define QOS_DSCP_AF13 0x38 -#define QOS_DSCP_CS2 0x40 -#define QOS_DSCP_AF21 0x48 -#define QOS_DSCP_AF22 0x50 -#define QOS_DSCP_AF23 0x58 -#define QOS_DSCP_CS3 0x60 -#define QOS_DSCP_AF31 0x68 -#define QOS_DSCP_AF32 0x70 -#define QOS_DSCP_AF33 0x78 -#define QOS_DSCP_CS4 0x80 -#define QOS_DSCP_AF41 0x88 -#define QOS_DSCP_AF42 0x90 -#define QOS_DSCP_AF43 0x98 -#define QOS_DSCP_CS5 0xa0 -#define QOS_DSCP_EF 0xb8 -#define QOS_DSCP_CS6 0xc0 -#define QOS_DSCP_CS7 0xe0 /* * External mbuf storage buffer types. From owner-svn-src-head@freebsd.org Tue Apr 16 16:59:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F4DE1577B39; Tue, 16 Apr 2019 16:59:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 149D86E053; Tue, 16 Apr 2019 16:59:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id u65so33694342itc.2; Tue, 16 Apr 2019 09:59:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=RCa2k6BAxKIj/45lFE9HAL+53u7COk+Q6FpZY3LBolc=; b=hi+VIsJNuJD5Acpv6BekKaPtbPEp5aFTMcb/nnygUzoSg8RyHzHHSXHXvylCqwhW88 vO+adcMh2uTCfUr+nyyJKVR1BMvHySW/AaC7aXTs4ILUefao7hT+W2a6ZR2Ef0enohlU 288gub9EF4QbZpHPTpMVGTJN4CclpMBw+cjbeFNQR57s/M7aDr7j8zUuaxoX8Cwyi6S6 4IbeR4odbZgDAsrmODJxw/DYYttv01Xz1wkYnUxzLfT7zzksoqZtO0oSljudw42UqHNo tvFHpwTUdiQGwClNLuK/8dHZQSlxJ7Opc0/vaEgyM7wXcbkYiP1nKib23DRhyoyDoA8N bL1Q== X-Gm-Message-State: APjAAAUpxoMOi8CqDeXBB4DmZkF6hHUioZUrIMDcT7YWOEycRjW39qSn Foeord0vUvm2aBMS8aC6g30BBG2/ X-Google-Smtp-Source: APXvYqxu1ruG+1X0LxqD+igqKWYNU33XANYLI/d+z1yHzNSSPaCYvUwekzYcSov6QkhCTq0qrqmd6Q== X-Received: by 2002:a05:6638:110:: with SMTP id x16mr17016376jao.75.1555433944512; Tue, 16 Apr 2019 09:59:04 -0700 (PDT) Received: from mail-it1-f181.google.com (mail-it1-f181.google.com. [209.85.166.181]) by smtp.gmail.com with ESMTPSA id b1sm9645632itd.12.2019.04.16.09.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 09:59:04 -0700 (PDT) Received: by mail-it1-f181.google.com with SMTP id x132so34176539itf.2; Tue, 16 Apr 2019 09:59:04 -0700 (PDT) X-Received: by 2002:a02:62ce:: with SMTP id d197mr94169jac.91.1555433944153; Tue, 16 Apr 2019 09:59:04 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> <310a420ee0b9e12249979d89dc4fa0d4cac5a8dc.camel@freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 09:58:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Warner Losh Cc: "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 149D86E053 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.989,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 16:59:06 -0000 On Tue, Apr 16, 2019 at 9:33 AM Warner Losh wrote: > In that case, we're better off having a MD routine that gets called if there's no loader-provided entropy pool. Yes, this is more or less the same plan I had. There's no need to add anything MD specific; we already abstract MD random sources behind the harvest mechanism. > (and requiring an NV store is not even an option to require, so don't go there). Systems lacking both an NV store and an entropy source available during mi_startup (i.e., not interrupts...) cannot safely provide entropy in early boot. On those systems, we must disable random consumption during early boot. > What we can't do is just hang if the loader can't provide an entropy pool. I think we're all on the same page there. Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 17:12:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D3615782D3; Tue, 16 Apr 2019 17:12:20 +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 A093B6E9BF; Tue, 16 Apr 2019 17:12:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6128A22A69; Tue, 16 Apr 2019 17:12:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GHCJFn020585; Tue, 16 Apr 2019 17:12:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GHCHiw020577; Tue, 16 Apr 2019 17:12:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904161712.x3GHCHiw020577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 16 Apr 2019 17:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346282 - in head: . share/man/man9 sys/dev/random sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: . share/man/man9 sys/dev/random sys/sys X-SVN-Commit-Revision: 346282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A093B6E9BF 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)[-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: Tue, 16 Apr 2019 17:12:20 -0000 Author: cem Date: Tue Apr 16 17:12:17 2019 New Revision: 346282 URL: https://svnweb.freebsd.org/changeset/base/346282 Log: random(4): Add is_random_seeded(9) KPI The imagined use is for early boot consumers of random to be able to make decisions based on whether random is available yet or not. One such consumer seems to be __stack_chk_init(), which runs immediately after random is initialized. A follow-up patch will attempt to address that. Reported by: many Reviewed by: delphij (except man page) Approved by: secteam(delphij) Differential Revision: https://reviews.freebsd.org/D19926 Modified: head/UPDATING head/share/man/man9/Makefile head/share/man/man9/random.9 head/sys/dev/random/random_infra.c head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/sys/param.h head/sys/sys/random.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 16 16:49:34 2019 (r346281) +++ head/UPDATING Tue Apr 16 17:12:17 2019 (r346282) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190416: + The loadable random module KPI has changed; the random_infra_init() + routine now requires a 3rd function pointer for a bool (*)(void) + method that returns true if the random device is seeded (and + therefore unblocked). + 20190404: r345895 reverts r320698. This implies that an nfsuserd(8) daemon built from head sources between r320757 (July 6, 2017) and Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Apr 16 16:49:34 2019 (r346281) +++ head/share/man/man9/Makefile Tue Apr 16 17:12:17 2019 (r346282) @@ -1668,6 +1668,7 @@ MLINKS+=psignal.9 gsignal.9 \ psignal.9 tdsignal.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ + random.9 is_random_seeded.9 \ random.9 read_random.9 \ random.9 read_random_uio.9 \ random.9 srandom.9 Modified: head/share/man/man9/random.9 ============================================================================== --- head/share/man/man9/random.9 Tue Apr 16 16:49:34 2019 (r346281) +++ head/share/man/man9/random.9 Tue Apr 16 17:12:17 2019 (r346282) @@ -26,13 +26,14 @@ .\" .\" $FreeBSD$ .\" " -.Dd April 15, 2019 +.Dd April 16, 2019 .Dt RANDOM 9 .Os .Sh NAME .Nm arc4rand , .Nm arc4random , .Nm arc4random_buf , +.Nm is_random_seeded , .Nm random , .Nm read_random , .Nm read_random_uio , @@ -48,6 +49,8 @@ .Fn arc4rand "void *ptr" "u_int length" "int reseed" .Pp .In sys/random.h +.Ft bool +.Fn is_random_seeded "void" .Ft void .Fn read_random "void *buffer" "int count" .Ft int @@ -106,6 +109,13 @@ is not used directly; instead, use the .Fn arc4rand family of functions. +.Pp +The +.Fn is_random_seeded +function can be used to check in advance if +.Fn read_random +will block. +(If random is seeded, it will not block.) .Pp The .Fn read_random_uio Modified: head/sys/dev/random/random_infra.c ============================================================================== --- head/sys/dev/random/random_infra.c Tue Apr 16 16:49:34 2019 (r346281) +++ head/sys/dev/random/random_infra.c Tue Apr 16 17:12:17 2019 (r346282) @@ -63,12 +63,20 @@ null_read_random(void *dummy __unused, u_int dummy2 __ panic("%s: no random module is loaded", __func__); } +static bool +null_is_random_seeded(void) +{ + return (false); +} + struct random_readers { int (*read_random_uio)(struct uio *, bool); void (*read_random)(void *, u_int); + bool (*is_random_seeded)(void); } random_reader_context = { (int (*)(struct uio *, bool))nullop, null_read_random, + null_is_random_seeded, }; struct sx randomdev_config_lock; @@ -82,12 +90,15 @@ random_infra_sysinit(void *dummy __unused) SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_FIRST, random_infra_sysinit, NULL); void -random_infra_init(int (*p_random_read_uio)(struct uio *, bool), void (*p_random_read)(void *, u_int)) +random_infra_init(int (*p_random_read_uio)(struct uio *, bool), + void (*p_random_read)(void *, u_int), + bool (*p_is_random_seeded)(void)) { RANDOM_CONFIG_X_LOCK(); random_reader_context.read_random_uio = p_random_read_uio; random_reader_context.read_random = p_random_read; + random_reader_context.is_random_seeded = p_is_random_seeded; RANDOM_CONFIG_X_UNLOCK(); } @@ -98,6 +109,7 @@ random_infra_uninit(void) RANDOM_CONFIG_X_LOCK(); random_reader_context.read_random_uio = (int (*)(struct uio *, bool))nullop; random_reader_context.read_random = null_read_random; + random_reader_context.is_random_seeded = null_is_random_seeded; RANDOM_CONFIG_X_UNLOCK(); } @@ -128,5 +140,14 @@ read_random(void *buf, u_int len) random_reader_context.read_random(buf, len); RANDOM_CONFIG_S_UNLOCK(); } + +bool +is_random_seeded(void) +{ + RANDOM_CONFIG_S_LOCK(); + random_reader_context.is_random_seeded(); + RANDOM_CONFIG_S_UNLOCK(); +} + #endif /* defined(RANDOM_LOADABLE) */ Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Tue Apr 16 16:49:34 2019 (r346281) +++ head/sys/dev/random/randomdev.c Tue Apr 16 17:12:17 2019 (r346282) @@ -62,11 +62,14 @@ __FBSDID("$FreeBSD$"); #if defined(RANDOM_LOADABLE) #define READ_RANDOM_UIO _read_random_uio #define READ_RANDOM _read_random +#define IS_RANDOM_SEEDED _is_random_seeded static int READ_RANDOM_UIO(struct uio *, bool); static void READ_RANDOM(void *, u_int); +static bool IS_RANDOM_SEEDED(void); #else #define READ_RANDOM_UIO read_random_uio #define READ_RANDOM read_random +#define IS_RANDOM_SEEDED is_random_seeded #endif static d_read_t randomdev_read; @@ -93,7 +96,7 @@ random_alg_context_ra_init_alg(void *data) p_random_alg_context = &random_alg_context; p_random_alg_context->ra_init_alg(data); #if defined(RANDOM_LOADABLE) - random_infra_init(READ_RANDOM_UIO, READ_RANDOM); + random_infra_init(READ_RANDOM_UIO, READ_RANDOM, IS_RANDOM_SEEDED); #endif } @@ -269,6 +272,12 @@ READ_RANDOM(void *random_buf, u_int len) explicit_bzero(remainder_buf, sizeof(remainder_buf)); } +} + +bool +IS_RANDOM_SEEDED(void) +{ + return (p_random_alg_context->ra_seeded()); } static __inline void Modified: head/sys/dev/random/randomdev.h ============================================================================== --- head/sys/dev/random/randomdev.h Tue Apr 16 16:49:34 2019 (r346281) +++ head/sys/dev/random/randomdev.h Tue Apr 16 17:12:17 2019 (r346282) @@ -118,7 +118,8 @@ extern struct sx randomdev_config_lock; #define RANDOM_CONFIG_S_LOCK(x) sx_slock(&randomdev_config_lock) #define RANDOM_CONFIG_S_UNLOCK(x) sx_sunlock(&randomdev_config_lock) #define RANDOM_CONFIG_DEINIT_LOCK(x) sx_destroy(&randomdev_config_lock) -void random_infra_init(int (*)(struct uio *, bool), void (*)(void *, u_int)); +void random_infra_init(int (*)(struct uio *, bool), void (*)(void *, u_int), + bool (*)(void)); void random_infra_uninit(void); #endif Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Apr 16 16:49:34 2019 (r346281) +++ head/sys/sys/param.h Tue Apr 16 17:12:17 2019 (r346282) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300018 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300019 /* 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 Tue Apr 16 16:49:34 2019 (r346281) +++ head/sys/sys/random.h Tue Apr 16 17:12:17 2019 (r346282) @@ -40,6 +40,7 @@ struct uio; #if defined(DEV_RANDOM) void read_random(void *, u_int); int read_random_uio(struct uio *, bool); +bool is_random_seeded(void); #else static __inline int read_random_uio(void *a __unused, u_int b __unused) @@ -49,6 +50,11 @@ read_random_uio(void *a __unused, u_int b __unused) static __inline void read_random(void *a __unused, u_int b __unused) { +} +static __inline bool +is_random_seeded(void) +{ + return (false); } #endif From owner-svn-src-head@freebsd.org Tue Apr 16 17:47:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CA421578E5E for ; Tue, 16 Apr 2019 17:47:54 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96B3D6FF96 for ; Tue, 16 Apr 2019 17:47:53 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555436869; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=AWBklre0KwtpSl8FfU5QkhBLd0Rv+DsOTpWN8Sf0rfAT0JFYnKpdOOB4iJKXsU9gN9LGL4K5FzSFF sQSgbw43tbc2W6FX9SUo84VWDvEyZ07ruJ8+H30r8yCn9rPnK1rS7ELzcO6TV9Utd5y/aFzO1cGH1+ kVneJAqySe8i1nZAKC8iDmPOPlILcXgArRoY3m5QQE8D0MmUSWakaiHrl6HO0LqYkHvJd88wAxoM/Y PK75m3XJmA6sxigo8uIYyzfwMz0jId39zDh3s6UireZFu+WwzFMwyLbDQ6xJuvV+sZBdo1Ia9OqItw t7AzlgHaLMDQcTkSu04phqBwSsepiTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=UDDuVMnJpcid1uDWmWisJHMRzVrfVzcw3+OtKIXYSkQ=; b=nTKC5gll5+teIOxnfJ5Tl361zgJwzkv6l3NPNbSOAbZgIHcw3CrB7BU1x0QOvnkXwwb/W0yYnYcib NolwdZSSG4/DFab3iOQVw25hIDTqKL5ehiNvZGvUxgFIcIWwHdSWrizYW0XU2MbwVamBYlqRULGbr1 4J9W1njdAJEnF4VKu4ZoNg40KGX9AAgNP1Z+YZLIVokDvFcqJqk7xXtE0m0zV+3gRAFbB73P6sV8Mr xwmB0ax85l/2r35RzqqZFUVD3STl5nYS3txjGUDV1isoL5d+A9H2wMiChh6glzFixKgXwWyB37NVLH SNXsqqxk4gGqrnTnpWQGLJmtSfXQG+w== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=UDDuVMnJpcid1uDWmWisJHMRzVrfVzcw3+OtKIXYSkQ=; b=CWi4PMhsg29fXsT5HHW/sQ5QqsGz0JZcFivevBxgsm0mzWcR2loIZYelBo8zylYZjpHxEaCvs7fa/ WAe4riAysceBMZ6qLndNmfWWtVb3QVnAi0haZAVS79siuTT6mFWWXQDbEdTHbMp5RhFDWXS1dkFcTW w128+twsIlR1eW+rEiY6Cot59+sPJKiaGuqyPRTgOiDDqL+xKm51UBRruQrTpHeVSTMKZ7RdGcWvDW OzaBr0w2p8H6YZsXZG1lFkqeYRoFNHgc5z3IyJbpd0dAF2Q4CLY+sWQqDtzf97dhyY2vxlpRs4lTko VepffHKkOAK+w7pJ8ek8Fgd2urUk4cw== X-MHO-RoutePath: aGlwcGll X-MHO-User: bd7c0d4a-606f-11e9-908b-352056dbf2de X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id bd7c0d4a-606f-11e9-908b-352056dbf2de; Tue, 16 Apr 2019 17:47:46 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3GHlisQ043599; Tue, 16 Apr 2019 11:47:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <0aedf8b8c91c2f9f76249c0a13e971fbb9aac16a.camel@freebsd.org> Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys From: Ian Lepore To: cem@freebsd.org, Warner Losh Cc: src-committers , svn-src-all , svn-src-head Date: Tue, 16 Apr 2019 11:47:44 -0600 In-Reply-To: References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <20190416150352.c604a280368ccb2992a861e8@bidouilliste.com> <310a420ee0b9e12249979d89dc4fa0d4cac5a8dc.camel@freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 96B3D6FF96 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.997,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, 16 Apr 2019 17:47:54 -0000 On Tue, 2019-04-16 at 09:58 -0700, Conrad Meyer wrote: > Systems lacking both an NV store and an entropy source available > during mi_startup (i.e., not interrupts...) cannot safely provide > entropy in early boot. On those systems, we must disable random > consumption during early boot. Or you could remember that one of the core unix philosphies is "tools, not policy" and leave it to embedded systems developers to decide for themselves what's "safe" or not. Not every application needs cryptographic strength entropy, especially for things like retrying after a short random delay or generating a random MAC address or whatever. -- Ian From owner-svn-src-head@freebsd.org Tue Apr 16 18:47:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9BD2157A4D4; Tue, 16 Apr 2019 18:47:21 +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 5058D72BBF; Tue, 16 Apr 2019 18:47:21 +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 2204823A02; Tue, 16 Apr 2019 18:47:21 +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 x3GIlKBb077015; Tue, 16 Apr 2019 18:47:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GIlKir077013; Tue, 16 Apr 2019 18:47:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904161847.x3GIlKir077013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 16 Apr 2019 18:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346292 - in head: . sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: . sys/kern X-SVN-Commit-Revision: 346292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5058D72BBF 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,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, 16 Apr 2019 18:47:22 -0000 Author: cem Date: Tue Apr 16 18:47:20 2019 New Revision: 346292 URL: https://svnweb.freebsd.org/changeset/base/346292 Log: stack_protector: Add tunable to bypass random cookies This is a stopgap measure to unbreak installer/VM/embedded boot issues introduced (or at least exposed by) in r346250. Add the new tunable, "security.stack_protect.permit_nonrandom_cookies," in order to continue boot with insecure non-random stack cookies if the random device is unavailable. For now, enable it by default. This is NOT safe. It will be disabled by default in a future revision. There is follow-on work planned to use fast random sources (e.g., RDRAND on x86 and DARN on Power) to seed when the early entropy file cannot be provided, for whatever reason. Please see D19928. Some better hacks may be used to make the non-random __stack_chk_guard slightly less predictable (from delphij@ and mjg@); those suggestions are left for a future revision. I think it may also be plausible to move stack guard initialization far later in the boot process; potentially it could be moved all the way to just before userspace is started. Reported by: many Reviewed by: delphij, emaste, imp (all w/ caveat: this is a stopgap fix) Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19927 Modified: head/UPDATING head/sys/kern/stack_protector.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 16 18:32:07 2019 (r346291) +++ head/UPDATING Tue Apr 16 18:47:20 2019 (r346292) @@ -32,6 +32,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20190416: + The tunable "security.stack_protect.permit_nonrandom_cookies" may be + set to a non-zero value to boot systems that do not provide early + entropy. Otherwise, such systems may see the panic message: + "cannot initialize stack cookies because random device is not yet + seeded." + +20190416: The loadable random module KPI has changed; the random_infra_init() routine now requires a 3rd function pointer for a bool (*)(void) method that returns true if the random device is seeded (and Modified: head/sys/kern/stack_protector.c ============================================================================== --- head/sys/kern/stack_protector.c Tue Apr 16 18:32:07 2019 (r346291) +++ head/sys/kern/stack_protector.c Tue Apr 16 18:47:20 2019 (r346292) @@ -4,12 +4,28 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include long __stack_chk_guard[8] = {}; void __stack_chk_fail(void); +/* + * XXX This default is unsafe!!! We intend to change it after resolving issues + * with early entropy in the installer; some kinds of systems that do not use + * loader(8), such as riscv, aarch64, and power; and perhaps others that I am + * forgetting off the top of my head. + */ +static bool permit_nonrandom_cookies = true; + +SYSCTL_NODE(_security, OID_AUTO, stack_protect, CTLFLAG_RW, 0, + "-fstack-protect support"); +SYSCTL_BOOL(_security_stack_protect, OID_AUTO, permit_nonrandom_cookies, + CTLFLAG_RDTUN, &permit_nonrandom_cookies, 0, + "Allow stack guard to be used without real random cookies"); + void __stack_chk_fail(void) { @@ -23,8 +39,37 @@ __stack_chk_init(void *dummy __unused) size_t i; long guard[nitems(__stack_chk_guard)]; - arc4rand(guard, sizeof(guard), 0); - for (i = 0; i < nitems(guard); i++) - __stack_chk_guard[i] = guard[i]; + if (is_random_seeded()) { + arc4rand(guard, sizeof(guard), 0); + for (i = 0; i < nitems(guard); i++) + __stack_chk_guard[i] = guard[i]; + return; + } + + if (permit_nonrandom_cookies) { + printf("%s: WARNING: Initializing stack protection with " + "non-random cookies!\n", __func__); + printf("%s: WARNING: This severely limits the benefit of " + "-fstack-protector!\n", __func__); + + /* + * The emperor is naked, but I rolled some dice and at least + * these values aren't zero. + */ + __stack_chk_guard[0] = (long)0xe7318d5959af899full; + __stack_chk_guard[1] = (long)0x35a9481c089348bfull; + __stack_chk_guard[2] = (long)0xde657fdc04117255ull; + __stack_chk_guard[3] = (long)0x0dd44c61c22e4a6bull; + __stack_chk_guard[4] = (long)0x0a5869a354edb0a5ull; + __stack_chk_guard[5] = (long)0x05cebfed255b5232ull; + __stack_chk_guard[6] = (long)0x270ffac137c4c72full; + __stack_chk_guard[7] = (long)0xd8141a789bad478dull; + _Static_assert(nitems(__stack_chk_guard) == 8, + "__stack_chk_guard doesn't have 8 items"); + return; + } + + panic("%s: cannot initialize stack cookies because random device is " + "not yet seeded", __func__); } SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL); From owner-svn-src-head@freebsd.org Tue Apr 16 19:38:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA6D5157B2A7; Tue, 16 Apr 2019 19:38:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4E36374976; Tue, 16 Apr 2019 19:38:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AF182426B; Tue, 16 Apr 2019 19:38:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GJcHlC003879; Tue, 16 Apr 2019 19:38:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GJcG3U003876; Tue, 16 Apr 2019 19:38:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904161938.x3GJcG3U003876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Apr 2019 19:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346293 - in head/sys/arm/allwinner: . clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm/allwinner: . clk X-SVN-Commit-Revision: 346293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E36374976 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.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 16 Apr 2019 19:38:18 -0000 Author: manu Date: Tue Apr 16 19:38:16 2019 New Revision: 346293 URL: https://svnweb.freebsd.org/changeset/base/346293 Log: allwinner: clk: Garbage collect old clock implementation The old clocks are disconneted from the build since r337344. Remove all those pseudo drivers. The only one remaining is for gmac (the ethernet controller) so move it to sys/arm/allwinner. While here remove a83t support from gmacclk as it is unneeded since r326114. MFC after: 1 month Added: head/sys/arm/allwinner/aw_gmacclk.c - copied, changed from r346292, head/sys/arm/allwinner/clk/aw_gmacclk.c Deleted: head/sys/arm/allwinner/clk/ Modified: head/sys/arm/allwinner/aw_ccu.c head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Tue Apr 16 18:47:20 2019 (r346292) +++ head/sys/arm/allwinner/aw_ccu.c Tue Apr 16 19:38:16 2019 (r346293) @@ -53,38 +53,18 @@ __FBSDID("$FreeBSD$"); #define CCU_BASE 0x01c20000 #define CCU_SIZE 0x400 -#define PRCM_BASE 0x01f01400 -#define PRCM_SIZE 0x200 - -#define SYSCTRL_BASE 0x01c00000 -#define SYSCTRL_SIZE 0x34 - struct aw_ccu_softc { struct simplebus_softc sc; bus_space_tag_t bst; - bus_space_handle_t ccu_bsh; - bus_space_handle_t prcm_bsh; - bus_space_handle_t sysctrl_bsh; + bus_space_handle_t bsh; struct mtx mtx; int flags; }; -#define CLOCK_CCU (1 << 0) -#define CLOCK_PRCM (1 << 1) -#define CLOCK_SYSCTRL (1 << 2) - static struct ofw_compat_data compat_data[] = { - { "allwinner,sun4i-a10", CLOCK_CCU }, - { "allwinner,sun5i-a13", CLOCK_CCU }, - { "allwinner,sun7i-a20", CLOCK_CCU }, - { "allwinner,sun6i-a31", CLOCK_CCU }, - { "allwinner,sun6i-a31s", CLOCK_CCU }, - { "allwinner,sun50i-a64", CLOCK_CCU }, - { "allwinner,sun50i-h5", CLOCK_CCU }, - { "allwinner,sun8i-a33", CLOCK_CCU }, - { "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL }, - { "allwinner,sun8i-h2-plus", CLOCK_CCU|CLOCK_PRCM }, - { "allwinner,sun8i-h3", CLOCK_CCU|CLOCK_PRCM }, + { "allwinner,sun7i-a20", 1 }, + { "allwinner,sun6i-a31", 1 }, + { "allwinner,sun6i-a31s", 1 }, { NULL, 0 } }; @@ -92,24 +72,11 @@ static int aw_ccu_check_addr(struct aw_ccu_softc *sc, bus_addr_t addr, bus_space_handle_t *pbsh, bus_size_t *poff) { - if (addr >= CCU_BASE && addr < (CCU_BASE + CCU_SIZE) && - (sc->flags & CLOCK_CCU) != 0) { + if (addr >= CCU_BASE && addr < (CCU_BASE + CCU_SIZE)) { *poff = addr - CCU_BASE; - *pbsh = sc->ccu_bsh; + *pbsh = sc->bsh; return (0); } - if (addr >= PRCM_BASE && addr < (PRCM_BASE + PRCM_SIZE) && - (sc->flags & CLOCK_PRCM) != 0) { - *poff = addr - PRCM_BASE; - *pbsh = sc->prcm_bsh; - return (0); - } - if (addr >= SYSCTRL_BASE && addr < (SYSCTRL_BASE + SYSCTRL_SIZE) && - (sc->flags & CLOCK_SYSCTRL) != 0) { - *poff = addr - SYSCTRL_BASE; - *pbsh = sc->sysctrl_bsh; - return (0); - } return (EINVAL); } @@ -241,29 +208,11 @@ aw_ccu_attach(device_t dev) * properties. */ sc->bst = bus_get_bus_tag(dev); - if (sc->flags & CLOCK_CCU) { - error = bus_space_map(sc->bst, CCU_BASE, CCU_SIZE, 0, - &sc->ccu_bsh); - if (error != 0) { - device_printf(dev, "couldn't map CCU: %d\n", error); - return (error); - } - } - if (sc->flags & CLOCK_PRCM) { - error = bus_space_map(sc->bst, PRCM_BASE, PRCM_SIZE, 0, - &sc->prcm_bsh); - if (error != 0) { - device_printf(dev, "couldn't map PRCM: %d\n", error); - return (error); - } - } - if (sc->flags & CLOCK_SYSCTRL) { - error = bus_space_map(sc->bst, SYSCTRL_BASE, SYSCTRL_SIZE, 0, - &sc->sysctrl_bsh); - if (error != 0) { - device_printf(dev, "couldn't map SYSCTRL: %d\n", error); - return (error); - } + error = bus_space_map(sc->bst, CCU_BASE, CCU_SIZE, 0, + &sc->bsh); + if (error != 0) { + device_printf(dev, "couldn't map CCU: %d\n", error); + return (error); } mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); Copied and modified: head/sys/arm/allwinner/aw_gmacclk.c (from r346292, head/sys/arm/allwinner/clk/aw_gmacclk.c) ============================================================================== --- head/sys/arm/allwinner/clk/aw_gmacclk.c Tue Apr 16 18:47:20 2019 (r346292, copy source) +++ head/sys/arm/allwinner/aw_gmacclk.c Tue Apr 16 19:38:16 2019 (r346293) @@ -77,21 +77,14 @@ __FBSDID("$FreeBSD$"); #define CLK_IDX_RGMII 1 #define CLK_IDX_COUNT 2 -enum aw_gmacclk_type { - GMACCLK_A20 = 1, - GMACCLK_A83T, -}; - static struct ofw_compat_data compat_data[] = { - { "allwinner,sun7i-a20-gmac-clk", GMACCLK_A20 }, - { "allwinner,sun8i-a83t-emac-clk", GMACCLK_A83T }, + { "allwinner,sun7i-a20-gmac-clk", 1 }, { NULL, 0 } }; struct aw_gmacclk_sc { device_t clkdev; bus_addr_t reg; - enum aw_gmacclk_type type; int rx_delay; int tx_delay; @@ -159,20 +152,6 @@ aw_gmacclk_set_mux(struct clknode *clk, int index) val &= ~(GMAC_CLK_SRC | GMAC_CLK_PIT); val |= (clk_src << GMAC_CLK_SRC_SHIFT); val |= (pit << GMAC_CLK_PIT_SHIFT); - if (sc->type == GMACCLK_A83T) { - val &= ~EMAC_TXC_DIV_CFG; - val |= (txc_div << EMAC_TXC_DIV_CFG_SHIFT); - val &= ~EMAC_PHY_SELECT; - val |= (EMAC_PHY_SELECT_EXT << EMAC_PHY_SELECT_SHIFT); - if (sc->tx_delay >= 0) { - val &= ~EMAC_ETXDC; - val |= (sc->tx_delay << EMAC_ETXDC_SHIFT); - } - if (sc->rx_delay >= 0) { - val &= ~EMAC_ERXDC; - val |= (sc->rx_delay << EMAC_ERXDC_SHIFT); - } - } GMACCLK_WRITE(sc, val); DEVICE_UNLOCK(sc); @@ -260,7 +239,6 @@ aw_gmacclk_attach(device_t dev) sc = clknode_get_softc(clk); sc->reg = paddr; sc->clkdev = device_get_parent(dev); - sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; sc->tx_delay = sc->rx_delay = -1; OF_getencprop(node, "tx-delay", &sc->tx_delay, sizeof(sc->tx_delay)); OF_getencprop(node, "rx-delay", &sc->rx_delay, sizeof(sc->rx_delay)); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue Apr 16 18:47:20 2019 (r346292) +++ head/sys/arm/allwinner/files.allwinner Tue Apr 16 19:38:16 2019 (r346293) @@ -34,7 +34,7 @@ arm/allwinner/aw_cir.c optional aw_cir evdev arm/allwinner/aw_reset.c standard arm/allwinner/aw_ccu.c standard -arm/allwinner/clk/aw_gmacclk.c standard +arm/allwinner/aw_gmacclk.c standard arm/allwinner/clkng/aw_ccung.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard From owner-svn-src-head@freebsd.org Tue Apr 16 19:46:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9774E157B633; Tue, 16 Apr 2019 19:46: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 3558A74E91; Tue, 16 Apr 2019 19:46: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 0E38A24427; Tue, 16 Apr 2019 19:46: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 x3GJk2Ql009119; Tue, 16 Apr 2019 19:46:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GJk2uH009117; Tue, 16 Apr 2019 19:46:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904161946.x3GJk2uH009117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Apr 2019 19:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346294 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 346294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3558A74E91 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)[-1.000,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: Tue, 16 Apr 2019 19:46:03 -0000 Author: kib Date: Tue Apr 16 19:46:02 2019 New Revision: 346294 URL: https://svnweb.freebsd.org/changeset/base/346294 Log: Fix initial x87 state after r345562. After the referenced commit, we did not set x87 and sse valid bits in the xstate_bv bitmask for initial fpu state (stored in memory), when using XSAVE. The state is loaded into FPU register file to initialize the process FPU state, and since both bits were clear, the default x87 and SSE states were loaded. By chance, FreeBSD ABI SSE2 state is same as FPU initial state, so the bug is not visible for 64bit processes. But on i386, the precision control should be set to double (53bit mantissa), instead of the default double extended (64bit mantissa). For 32bit processes on amd64, kernel reloads control word with the right mask, which only left native i386 and amd64 native but using x87 as affected. Fix it by setting minimal required xstate_bv mask. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c head/sys/i386/i386/npx.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Tue Apr 16 19:38:16 2019 (r346293) +++ head/sys/amd64/amd64/fpu.c Tue Apr 16 19:46:02 2019 (r346294) @@ -370,6 +370,7 @@ fpuinit(void) static void fpuinitstate(void *arg __unused) { + uint64_t *xstate_bv; register_t saveintr; int cp[4], i, max_ext_n; @@ -400,6 +401,10 @@ fpuinitstate(void *arg __unused) * Save Area. */ if (use_xsave) { + xstate_bv = (uint64_t *)((char *)(fpu_initialstate + 1) + + offsetof(struct xstate_hdr, xstate_bv)); + *xstate_bv = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; + max_ext_n = flsl(xsave_mask); xsave_area_desc = malloc(max_ext_n * sizeof(struct xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Tue Apr 16 19:38:16 2019 (r346293) +++ head/sys/i386/i386/npx.c Tue Apr 16 19:46:02 2019 (r346294) @@ -472,6 +472,7 @@ npxinit(bool bsp) static void npxinitstate(void *arg __unused) { + uint64_t *xstate_bv; register_t saveintr; int cp[4], i, max_ext_n; @@ -507,6 +508,7 @@ npxinitstate(void *arg __unused) sizeof(npx_initialstate->sv_xmm.sv_fp)); bzero(npx_initialstate->sv_xmm.sv_xmm, sizeof(npx_initialstate->sv_xmm.sv_xmm)); + } else bzero(npx_initialstate->sv_87.sv_ac, sizeof(npx_initialstate->sv_87.sv_ac)); @@ -516,6 +518,10 @@ npxinitstate(void *arg __unused) * Save Area. */ if (use_xsave) { + xstate_bv = (uint64_t *)((char *)(npx_initialstate + 1) + + offsetof(struct xstate_hdr, xstate_bv)); + *xstate_bv = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; + if (xsave_mask >> 32 != 0) max_ext_n = fls(xsave_mask >> 32) + 32; else From owner-svn-src-head@freebsd.org Tue Apr 16 20:04:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB251157BB9F; Tue, 16 Apr 2019 20:04:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 6508D757D2; Tue, 16 Apr 2019 20:04:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D690247A4; Tue, 16 Apr 2019 20:04:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GK4RpI019672; Tue, 16 Apr 2019 20:04:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GK4N7u019636; Tue, 16 Apr 2019 20:04:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904162004.x3GK4N7u019636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Apr 2019 20:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346295 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124 a... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124 arm/qemu arm/ralink arm/ro... X-SVN-Commit-Revision: 346295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6508D757D2 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 20:04:28 -0000 Author: manu Date: Tue Apr 16 20:04:22 2019 New Revision: 346295 URL: https://svnweb.freebsd.org/changeset/base/346295 Log: arm: Add kern_clocksource.c directly in files.arm This files is needed and included in all our config so move it to a common location. MFC after: 2 weeks Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/altera/socfpga/files.socfpga head/sys/arm/amlogic/aml8726/files.aml8726 head/sys/arm/annapurna/alpine/files.alpine head/sys/arm/broadcom/bcm2835/files.bcm283x head/sys/arm/freescale/imx/files.imx5 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/vybrid/files.vybrid head/sys/arm/mv/files.arm7 head/sys/arm/mv/files.mv head/sys/arm/nvidia/tegra124/files.tegra124 head/sys/arm/qemu/files.qemu head/sys/arm/ralink/files.ralink head/sys/arm/rockchip/files.rk30xx head/sys/arm/samsung/exynos/files.exynos5 head/sys/arm/ti/files.ti head/sys/arm/versatile/files.versatile head/sys/arm/xilinx/files.zynq7 head/sys/conf/files.arm Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/allwinner/files.allwinner Tue Apr 16 20:04:22 2019 (r346295) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/altera/socfpga/files.socfpga Tue Apr 16 20:04:22 2019 (r346295) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/altera/socfpga/socfpga_common.c standard arm/altera/socfpga/socfpga_machdep.c standard arm/altera/socfpga/socfpga_manager.c standard Modified: head/sys/arm/amlogic/aml8726/files.aml8726 ============================================================================== --- head/sys/arm/amlogic/aml8726/files.aml8726 Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/amlogic/aml8726/files.aml8726 Tue Apr 16 20:04:22 2019 (r346295) @@ -1,7 +1,5 @@ #$FreeBSD$ -kern/kern_clocksource.c standard - arm/amlogic/aml8726/aml8726_l2cache.c standard arm/amlogic/aml8726/aml8726_machdep.c standard Modified: head/sys/arm/annapurna/alpine/files.alpine ============================================================================== --- head/sys/arm/annapurna/alpine/files.alpine Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/annapurna/alpine/files.alpine Tue Apr 16 20:04:22 2019 (r346295) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/versatile/sp804.c standard dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm283x Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Tue Apr 16 20:04:22 2019 (r346295) @@ -18,8 +18,6 @@ arm/broadcom/bcm2835/bcm2835_vcio.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt -kern/kern_clocksource.c standard - dev/mbox/mbox_if.m standard arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ Modified: head/sys/arm/freescale/imx/files.imx5 ============================================================================== --- head/sys/arm/freescale/imx/files.imx5 Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/freescale/imx/files.imx5 Tue Apr 16 20:04:22 2019 (r346295) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard # Init arm/freescale/imx/imx_common.c standard Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/freescale/imx/files.imx6 Tue Apr 16 20:04:22 2019 (r346295) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard imx6 devices and support. # arm/freescale/fsl_ocotp.c standard Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/freescale/vybrid/files.vybrid Tue Apr 16 20:04:22 2019 (r346295) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/freescale/vybrid/vf_machdep.c standard arm/freescale/vybrid/vf_ccm.c standard arm/freescale/vybrid/vf_anadig.c standard Modified: head/sys/arm/mv/files.arm7 ============================================================================== --- head/sys/arm/mv/files.arm7 Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/mv/files.arm7 Tue Apr 16 20:04:22 2019 (r346295) @@ -36,5 +36,3 @@ dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci - -kern/kern_clocksource.c standard Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/mv/files.mv Tue Apr 16 20:04:22 2019 (r346295) @@ -33,5 +33,3 @@ dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci - -kern/kern_clocksource.c standard Modified: head/sys/arm/nvidia/tegra124/files.tegra124 ============================================================================== --- head/sys/arm/nvidia/tegra124/files.tegra124 Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/nvidia/tegra124/files.tegra124 Tue Apr 16 20:04:22 2019 (r346295) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard tegra124 devices and support. # arm/nvidia/tegra124/tegra124_machdep.c standard Modified: head/sys/arm/qemu/files.qemu ============================================================================== --- head/sys/arm/qemu/files.qemu Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/qemu/files.qemu Tue Apr 16 20:04:22 2019 (r346295) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard qemu virt devices and support. # arm/qemu/virt_machdep.c standard Modified: head/sys/arm/ralink/files.ralink ============================================================================== --- head/sys/arm/ralink/files.ralink Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/ralink/files.ralink Tue Apr 16 20:04:22 2019 (r346295) @@ -5,5 +5,3 @@ arm/ralink/rt1310_gpio.c optional rt1310gpio arm/ralink/rt1310_timer.c standard arm/ralink/if_fv.c optional fv -kern/kern_clocksource.c standard - Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/rockchip/files.rk30xx Tue Apr 16 20:04:22 2019 (r346295) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/samsung/exynos/files.exynos5 Tue Apr 16 20:04:22 2019 (r346295) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/samsung/exynos/exynos5_mct.c standard arm/samsung/exynos/exynos5_mp.c optional smp arm/samsung/exynos/exynos5_machdep.c standard Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/ti/files.ti Tue Apr 16 20:04:22 2019 (r346295) @@ -1,7 +1,5 @@ #$FreeBSD$ -kern/kern_clocksource.c standard - arm/ti/ti_cpuid.c standard arm/ti/ti_hwmods.c standard arm/ti/ti_machdep.c standard Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/versatile/files.versatile Tue Apr 16 20:04:22 2019 (r346295) @@ -8,5 +8,3 @@ arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci arm/versatile/versatile_scm.c standard arm/versatile/versatile_sic.c standard - -kern/kern_clocksource.c standard Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/arm/xilinx/files.zynq7 Tue Apr 16 20:04:22 2019 (r346295) @@ -3,8 +3,6 @@ # # $FreeBSD$ -kern/kern_clocksource.c standard - arm/xilinx/zy7_machdep.c standard arm/xilinx/zy7_l2cache.c standard arm/xilinx/zy7_slcr.c standard Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Apr 16 19:46:02 2019 (r346294) +++ head/sys/conf/files.arm Tue Apr 16 20:04:22 2019 (r346295) @@ -11,6 +11,9 @@ cloudabi32_vdso_blob.o optional compat_cloudabi32 \ no-implicit-rule \ clean "cloudabi32_vdso_blob.o" # + +kern/kern_clocksource.c standard + arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt arm/annapurna/alpine/alpine_pci.c optional al_pci fdt @@ -167,3 +170,4 @@ libkern/qdivrem.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard + From owner-svn-src-head@freebsd.org Tue Apr 16 20:06:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABA9A157BD28; Tue, 16 Apr 2019 20:06:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4FC4A75D1F; Tue, 16 Apr 2019 20:06:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F70C247BE; Tue, 16 Apr 2019 20:06:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GK6dSN020343; Tue, 16 Apr 2019 20:06:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GK6dpY020342; Tue, 16 Apr 2019 20:06:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904162006.x3GK6dpY020342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Apr 2019 20:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346297 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 346297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FC4A75D1F 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.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 20:06:40 -0000 Author: manu Date: Tue Apr 16 20:06:39 2019 New Revision: 346297 URL: https://svnweb.freebsd.org/changeset/base/346297 Log: arm: Order files.arm to have cloudabi and annapurna sections MFC after: 2 weeks Modified: head/sys/conf/files.arm Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Apr 16 20:05:24 2019 (r346296) +++ head/sys/conf/files.arm Tue Apr 16 20:06:39 2019 (r346297) @@ -1,26 +1,7 @@ # $FreeBSD$ -cloudabi32_vdso.o optional compat_cloudabi32 \ - dependency "$S/contrib/cloudabi/cloudabi_vdso_armv6.S" \ - compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_armv6.S -o ${.TARGET}" \ - no-obj no-implicit-rule \ - clean "cloudabi32_vdso.o" -# -cloudabi32_vdso_blob.o optional compat_cloudabi32 \ - dependency "cloudabi32_vdso.o" \ - compile-with "${OBJCOPY} --input-target binary --output-target elf32-littlearm --binary-architecture arm cloudabi32_vdso.o ${.TARGET}" \ - no-implicit-rule \ - clean "cloudabi32_vdso_blob.o" -# kern/kern_clocksource.c standard -arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt -arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt -arm/annapurna/alpine/alpine_pci.c optional al_pci fdt -arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt -arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ - no-depend \ - compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" arm/arm/autoconf.c standard arm/arm/bcopy_page.S standard arm/arm/bcopyinout.S standard @@ -171,3 +152,25 @@ libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard +# CloudABI support +cloudabi32_vdso.o optional compat_cloudabi32 \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_armv6.S" \ + compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_armv6.S -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "cloudabi32_vdso.o" +# +cloudabi32_vdso_blob.o optional compat_cloudabi32 \ + dependency "cloudabi32_vdso.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf32-littlearm --binary-architecture arm cloudabi32_vdso.o ${.TARGET}" \ + no-implicit-rule \ + clean "cloudabi32_vdso_blob.o" +# + +# Annapurna support +arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt +arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt +arm/annapurna/alpine/alpine_pci.c optional al_pci fdt +arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt +arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" From owner-svn-src-head@freebsd.org Tue Apr 16 20:08:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F973157BDFA; Tue, 16 Apr 2019 20:08:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 A748A75F14; Tue, 16 Apr 2019 20:08:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E049247BF; Tue, 16 Apr 2019 20:08:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GK8KBv020457; Tue, 16 Apr 2019 20:08:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GK8KuR020456; Tue, 16 Apr 2019 20:08:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904162008.x3GK8KuR020456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Apr 2019 20:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346298 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 346298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A748A75F14 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.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 16 Apr 2019 20:08:21 -0000 Author: manu Date: Tue Apr 16 20:08:19 2019 New Revision: 346298 URL: https://svnweb.freebsd.org/changeset/base/346298 Log: config: Only warn if duplicate option/device comes from the same file This is useful for arm (possibly other arches too) where we want to have a GENERIC kernel that only include files for the different SoC. Since multiple SoCs/Board needs the same device we would need to do either : Include the device in a generic file Include the device in each file that really needs it Option 1 works but if someone wants to create a specific kernel config (which isn't uncommon for embedded system), he will need to add a lots of nodevice to it. Option 2 also works but produce a lots of warnings. Reviewed by: kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19424 Modified: head/usr.sbin/config/config.h head/usr.sbin/config/config.y Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Tue Apr 16 20:06:39 2019 (r346297) +++ head/usr.sbin/config/config.h Tue Apr 16 20:08:19 2019 (r346298) @@ -86,6 +86,7 @@ struct files_name { struct device { int d_done; /* processed */ char *d_name; /* name of device (e.g. rk11) */ + char *yyfile; /* name of the file that first include the device */ #define UNKNOWN -2 /* -2 means not set yet */ STAILQ_ENTRY(device) d_next; /* Next one in list */ }; @@ -125,6 +126,7 @@ struct opt { char *op_name; char *op_value; int op_ownfile; /* true = own file, false = makefile */ + char *yyfile; /* name of the file that first include the option */ SLIST_ENTRY(opt) op_next; SLIST_ENTRY(opt) op_append; }; Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Tue Apr 16 20:06:39 2019 (r346297) +++ head/usr.sbin/config/config.y Tue Apr 16 20:08:19 2019 (r346298) @@ -382,11 +382,13 @@ finddev(struct device_head *dlist, char *name) static void newdev(char *name) { - struct device *np; + struct device *np, *dp; - if (finddev(&dtab, name)) { - fprintf(stderr, - "WARNING: duplicate device `%s' encountered.\n", name); + if ((dp = finddev(&dtab, name)) != NULL) { + if (strcmp(dp->yyfile, yyfile) == 0) + fprintf(stderr, + "WARNING: duplicate device `%s' encountered in %s\n", + name, yyfile); return; } @@ -394,6 +396,7 @@ newdev(char *name) if (np == NULL) err(EXIT_FAILURE, "calloc"); np->d_name = name; + np->yyfile = strdup(yyfile); STAILQ_INSERT_TAIL(&dtab, np, d_next); } @@ -408,6 +411,7 @@ rmdev_schedule(struct device_head *dh, char *name) dp = finddev(dh, name); if (dp != NULL) { STAILQ_REMOVE(dh, dp, device, d_next); + free(dp->yyfile); free(dp->d_name); free(dp); } @@ -446,8 +450,9 @@ newopt(struct opt_head *list, char *name, char *value, op2 = findopt(list, name); if (op2 != NULL && !append && !dupe) { - fprintf(stderr, - "WARNING: duplicate option `%s' encountered.\n", name); + if (strcmp(op2->yyfile, yyfile) == 0) + fprintf(stderr, + "WARNING: duplicate option `%s' encountered.\n", name); return; } @@ -457,6 +462,7 @@ newopt(struct opt_head *list, char *name, char *value, op->op_name = name; op->op_ownfile = 0; op->op_value = value; + op->yyfile = strdup(yyfile); if (op2 != NULL) { if (append) { while (SLIST_NEXT(op2, op_append) != NULL) @@ -481,6 +487,7 @@ rmopt_schedule(struct opt_head *list, char *name) while ((op = findopt(list, name)) != NULL) { SLIST_REMOVE(list, op, opt, op_next); + free(op->yyfile); free(op->op_name); free(op); } From owner-svn-src-head@freebsd.org Tue Apr 16 20:41:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 326C3157CC88; Tue, 16 Apr 2019 20:41:05 +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 CA7A477231; Tue, 16 Apr 2019 20:41:04 +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 A78D624D36; Tue, 16 Apr 2019 20:41:04 +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 x3GKf4kS037014; Tue, 16 Apr 2019 20:41:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GKf4oQ037013; Tue, 16 Apr 2019 20:41:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904162041.x3GKf4oQ037013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 16 Apr 2019 20:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346299 - 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: 346299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA7A477231 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)[-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: Tue, 16 Apr 2019 20:41:05 -0000 Author: emaste Date: Tue Apr 16 20:41:04 2019 New Revision: 346299 URL: https://svnweb.freebsd.org/changeset/base/346299 Log: iflibtxrx.9: update function descriptions to match implementation isc_rxd_refill, isc_rxd_flush return nothing, not void *. isc_txd_credits_update, isc_rxd_available return int, not int *. isc_txd_credits_update has a bool as final argument, not a uint32_t. Prior to r315217 it took four arguments; the final two were uint32_t, bool. Reported by: Gerald Aryeetey MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/iflibtxrx.9 Modified: head/share/man/man9/iflibtxrx.9 ============================================================================== --- head/share/man/man9/iflibtxrx.9 Tue Apr 16 20:08:19 2019 (r346298) +++ head/share/man/man9/iflibtxrx.9 Tue Apr 16 20:41:04 2019 (r346299) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd March 23, 2017 +.Dd April 16, 2019 .Dt IFLIBTXTX 9 .Os .Sh NAME @@ -19,19 +19,19 @@ .Fa "uint16_t qid" .Fa "uint32_t _pidx_or_credits_" .Fc -.Ft int * +.Ft int .Fo isc_txd_credits_update .Fa "void *sc" .Fa "uint16_t qid" -.Fa "uint32_t credits" +.Fa "bool clear" .Fc -.Ft int * +.Ft int .Fo isc_rxd_available .Fa "void *sc" .Fa "uint16_t qsid" .Fa "uint32_t cidx" .Fc -.Ft void * +.Ft void .Fo isc_rxd_refill .Fa "void *sc" .Fa "uint16_t qsid" @@ -41,7 +41,7 @@ .Fa "caddr_t *vaddrs" .Fa "uint16_t count" .Fc -.Ft void * +.Ft void .Fo isc_rxd_flush .Fa "void *sc" .Fa "uint16_t qsid" From owner-svn-src-head@freebsd.org Tue Apr 16 21:28:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 801E7157E0D8; Tue, 16 Apr 2019 21:28:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19661814E4; Tue, 16 Apr 2019 21:28:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (unknown [IPv6:2601:648:8880:1e30:50e5:2fcc:d66f:cb37]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3266416B0D; Tue, 16 Apr 2019 21:28:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: Hans Petter Selasky , "Andrey V. Elsukov" , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@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: <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> Date: Tue, 16 Apr 2019 14:28:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 19661814E4 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.954,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: Tue, 16 Apr 2019 21:28:31 -0000 On 4/16/19 8:32 AM, Hans Petter Selasky wrote: > On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >> On 05.12.2018 17:25, Slava Shwartsman wrote: >>> Author: slavash >>> Date: Wed Dec 5 14:25:03 2018 >>> New Revision: 341586 >>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>> >>> Log: >>> mlx5en: Implement backpressure indication. >>> >>> The backpressure indication is implemented using an unlimited rate type of >>> mbuf send tag. When the upper layers typically the socket layer has obtained such >>> a tag, it can then query the destination driver queue for the current >>> amount of space available in the send queue. >>> >>> A single mbuf send tag may be referenced multiple times and a refcount has been added >>> to the mlx5e_priv structure to track its usage. Because the send tag resides >>> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >>> zero until the mlx4en(4) driver is detached. The channels structure is persistant >>> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >>> without any need of synchronization. >>> >>> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >>> two different tag types which end up in the driver which need to be distinguished. >>> >>> Submitted by: hselasky@ >>> Approved by: hselasky (mentor) >>> MFC after: 1 week >>> Sponsored by: Mellanox Technologies >>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>> struct mlx5e_sq *sq; >>> int ret; >>> >>> - sq = mlx5e_select_queue(ifp, mb); >>> - if (unlikely(sq == NULL)) { >>> -#ifdef RATELIMIT >>> - /* Check for route change */ >>> - if (mb->m_pkthdr.snd_tag != NULL && >>> - mb->m_pkthdr.snd_tag->ifp != ifp) { >>> + if (mb->m_pkthdr.snd_tag != NULL) { >>> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>> + if (unlikely(sq == NULL)) { >>> + /* Check for route change */ >>> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>> + /* Free mbuf */ >>> + m_freem(mb); >>> + >>> + /* >>> + * Tell upper layers about route >>> + * change and to re-transmit this >>> + * packet: >>> + */ >>> + return (EAGAIN); >>> + } >> >> Hi, >> >> I just discovered something strange and found that this commit is the >> cause. >> The test system has mlx5en 100G interface. It has two vlans: vlan500 and >> vlan100. >> Via vlan500 it receives some packets flows. Then it routes these packets >> into vlan100. >> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >> >> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >> CPU ID FUNCTION:NAME >> 23 54338 ip6_output:return 35 >> 16 54338 ip6_output:return 35 >> 21 54338 ip6_output:return 35 >> 22 54338 ip6_output:return 35 >> 24 54338 ip6_output:return 35 >> 23 54338 ip6_output:return 35 >> 14 54338 ip6_output:return 35 >> ^C >> >> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >> CPU ID FUNCTION:NAME >> 16 69030 mlx5e_xmit:return 35 >> 23 69030 mlx5e_xmit:return 35 >> 26 69030 mlx5e_xmit:return 35 >> 25 69030 mlx5e_xmit:return 35 >> 24 69030 mlx5e_xmit:return 35 >> 21 69030 mlx5e_xmit:return 35 >> 26 69030 mlx5e_xmit:return 35 >> ^C >> >> The kernel config is GENERIC. >> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >> > > Hi, > > This might be a case where rcvif in the mbuf's pktheader is not cleared > before the packet is fed back on the wire. > > John Baldwin is working on the send tags implementation, to eliminate > the EAGAIN handling in the network drivers. I will try to push this branch sooner then since it affects more than just TLS. Part of the change includes a new flag we can use to assert that we aren't just getting a stale rcvif (though there are also now assertions in ip_output that should catch this case I think). -- John Baldwin From owner-svn-src-head@freebsd.org Tue Apr 16 21:32:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 677DA157E336; Tue, 16 Apr 2019 21:32:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06C4F818E9; Tue, 16 Apr 2019 21:32:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (unknown [IPv6:2601:648:8880:1e30:50e5:2fcc:d66f:cb37]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 660E916C37; Tue, 16 Apr 2019 21:32:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904151840.x3FIeaEQ009242@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: <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> Date: Tue, 16 Apr 2019 14:32:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201904151840.x3FIeaEQ009242@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 06C4F818E9 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 21:32:44 -0000 On 4/15/19 11:40 AM, Conrad Meyer wrote: > Author: cem > Date: Mon Apr 15 18:40:36 2019 > New Revision: 346250 > URL: https://svnweb.freebsd.org/changeset/base/346250 > > Log: > random(4): Block read_random(9) on initial seeding > > read_random() is/was used, mostly without error checking, in a lot of > very sensitive places in the kernel -- including seeding the widely used > arc4random(9). > > Most uses, especially arc4random(9), should block until the device is seeded > rather than proceeding with a bogus or empty seed. I did not spy any > obvious kernel consumers where blocking would be inappropriate (in the > sense that lack of entropy would be ok -- I did not investigate locking > angle thoroughly). In many instances, arc4random_buf(9) or that family > of APIs would be more appropriate anyway; that work was done in r345865. There are definitely places arc4random is used where sleeping is not allowed. ipsec generating nonces for AES-CBC is one example I can think of off the top of my head. I think it might be useful to add an explicit WITNESS_WARN in arc4random to catch these cases so they can be found and reasoned about. > This change primarily impacts the behavior of /dev/random on embedded > systems with read-only media that do not configure "nodevice random". We > toggle the default from 'charge on blindly with no entropy' to 'block > indefinitely.' This default is safer, but may cause frustration. Embedded > system designers using FreeBSD have several options. The most obvious is to > plan to have a small writable NVRAM or NAND to persist entropy, like larger > systems. Early entropy can be fed from any loader, or by writing directly > to /dev/random during boot. Some embedded SoCs now provide a fast hardware > entropy source; this would also work for quickly seeding Fortuna. A 3rd > option would be creating an embedded-specific, more simplistic random > module, like that designed by DJB in [1] (this design still requires a small > rewritable media for forward secrecy). Finally, the least preferred option > might be "nodevice random", although I plan to remove this in a subsequent > revision. Note that I actually often run into unseeded systems when doing development using qemu for non-x86 architectures. For example, when booting mips from qemu, there is no loader, the kernel just starts, and since the endian is opposite, I frequently regenerate the filesystem using makefs. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Apr 16 22:42:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D45C157FA71; Tue, 16 Apr 2019 22:42:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 E010B83963; Tue, 16 Apr 2019 22:42:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6A9C2637B; Tue, 16 Apr 2019 22:42:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3GMgol5003906; Tue, 16 Apr 2019 22:42:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3GMgolV003904; Tue, 16 Apr 2019 22:42:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904162242.x3GMgolV003904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Apr 2019 22:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346305 - in head/sys/arm: allwinner conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm: allwinner conf X-SVN-Commit-Revision: 346305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E010B83963 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 16 Apr 2019 22:42:51 -0000 Author: manu Date: Tue Apr 16 22:42:50 2019 New Revision: 346305 URL: https://svnweb.freebsd.org/changeset/base/346305 Log: arm: allwinner: Makes more device optional MFC after: 2 weeks Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/GENERIC Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue Apr 16 21:09:57 2019 (r346304) +++ head/sys/arm/allwinner/files.allwinner Tue Apr 16 22:42:50 2019 (r346305) @@ -2,10 +2,10 @@ arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound -arm/allwinner/a10_dmac.c standard -arm/allwinner/a31_dmac.c standard +arm/allwinner/a10_dmac.c optional a10_dmac +arm/allwinner/a31_dmac.c optional a31_dmac arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/a10_sramc.c standard +arm/allwinner/a10_sramc.c optional SOC_ALLWINNER_A10 arm/allwinner/aw_gpio.c optional gpio arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_machdep.c standard @@ -13,21 +13,21 @@ arm/allwinner/aw_mmc.c optional mmc | mmccam arm/allwinner/aw_mp.c optional smp arm/allwinner/aw_nmi.c optional intrng arm/allwinner/aw_rsb.c optional rsb | p2wi -arm/allwinner/aw_rtc.c standard +arm/allwinner/aw_rtc.c optional aw_rtc arm/allwinner/aw_syscon.c optional ext_resources syscon -arm/allwinner/aw_ts.c standard +arm/allwinner/aw_ts.c optional aw_thermal arm/allwinner/aw_usbphy.c optional ehci | ohci -arm/allwinner/aw_wdog.c standard +arm/allwinner/aw_wdog.c optional aw_wdog arm/allwinner/axp209.c optional axp209 arm/allwinner/axp81x.c optional axp81x arm/allwinner/if_awg.c optional awg ext_resources syscon arm/allwinner/if_emac.c optional emac -arm/allwinner/sunxi_dma_if.m standard +arm/allwinner/sunxi_dma_if.m optional a10_dmac | a31_dmac dev/iicbus/twsi/a10_twsi.c optional twsi dev/usb/controller/generic_ohci.c optional ohci dev/usb/controller/generic_usb_if.m optional ohci -arm/allwinner/aw_sid.c standard -arm/allwinner/aw_thermal.c standard +arm/allwinner/aw_sid.c optional aw_sid +arm/allwinner/aw_thermal.c optional aw_thermal dev/iicbus/sy8106a.c optional sy8106a arm/allwinner/aw_cir.c optional aw_cir evdev Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Tue Apr 16 21:09:57 2019 (r346304) +++ head/sys/arm/conf/GENERIC Tue Apr 16 22:42:50 2019 (r346305) @@ -181,6 +181,7 @@ device ti_adc # watchdog. device ti_wdt device imxwdt # Watchdog. WARNING: can't be disabled!!! +device aw_wdog # Allwinner Watchdog device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) @@ -253,6 +254,8 @@ device ti_mbox # DMA controller device fslsdma device ti_sdma +device a10_dmac +device a31_dmac # Extensible Firmware Interface options EFI @@ -262,8 +265,15 @@ device cesa device crypto device cryptodev -# imx6 on-chip RTC -device imx6_snvs # On-chip RTC +# RTC +device imx6_snvs # IMX6 On-chip RTC +device aw_rtc # Allwinner On-chip RTC + +# EFUSE +device aw_sid # Allwinner Secure ID EFUSE + +# Thermal sensors +device aw_thermal # Allwinner Thermal Sensor Controller # Flattened Device Tree options FDT # Configure using FDT/DTB data From owner-svn-src-head@freebsd.org Tue Apr 16 22:51:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A2C2157FC88; Tue, 16 Apr 2019 22:51:04 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 E098883B84; Tue, 16 Apr 2019 22:51:03 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3GMp2n9097104; Tue, 16 Apr 2019 15:51:02 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3GMp2aF097103; Tue, 16 Apr 2019 15:51:02 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys In-Reply-To: <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> To: John Baldwin Date: Tue, 16 Apr 2019 15:51:02 -0700 (PDT) CC: Conrad Meyer , 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: E098883B84 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]; 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: Tue, 16 Apr 2019 22:51:04 -0000 > On 4/15/19 11:40 AM, Conrad Meyer wrote: > > Author: cem > > Date: Mon Apr 15 18:40:36 2019 > > New Revision: 346250 > > URL: https://svnweb.freebsd.org/changeset/base/346250 > > > > Log: > > random(4): Block read_random(9) on initial seeding > > > > read_random() is/was used, mostly without error checking, in a lot of > > very sensitive places in the kernel -- including seeding the widely used > > arc4random(9). > > > > Most uses, especially arc4random(9), should block until the device is seeded > > rather than proceeding with a bogus or empty seed. I did not spy any > > obvious kernel consumers where blocking would be inappropriate (in the > > sense that lack of entropy would be ok -- I did not investigate locking > > angle thoroughly). In many instances, arc4random_buf(9) or that family > > of APIs would be more appropriate anyway; that work was done in r345865. > > There are definitely places arc4random is used where sleeping is not allowed. > ipsec generating nonces for AES-CBC is one example I can think of off the > top of my head. I think it might be useful to add an explicit WITNESS_WARN > in arc4random to catch these cases so they can be found and reasoned about. > > > This change primarily impacts the behavior of /dev/random on embedded > > systems with read-only media that do not configure "nodevice random". We > > toggle the default from 'charge on blindly with no entropy' to 'block > > indefinitely.' This default is safer, but may cause frustration. Embedded > > system designers using FreeBSD have several options. The most obvious is to > > plan to have a small writable NVRAM or NAND to persist entropy, like larger > > systems. Early entropy can be fed from any loader, or by writing directly > > to /dev/random during boot. Some embedded SoCs now provide a fast hardware > > entropy source; this would also work for quickly seeding Fortuna. A 3rd > > option would be creating an embedded-specific, more simplistic random > > module, like that designed by DJB in [1] (this design still requires a small > > rewritable media for forward secrecy). Finally, the least preferred option > > might be "nodevice random", although I plan to remove this in a subsequent > > revision. > > Note that I actually often run into unseeded systems when doing development > using qemu for non-x86 architectures. For example, when booting mips from > qemu, there is no loader, the kernel just starts, and since the endian is > opposite, I frequently regenerate the filesystem using makefs. Isnt this also the case for bhyveload? We do not go through the loader there when we are starting a FreeBSD guest, correct? > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Apr 16 22:56:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10E9B157FFC8; Tue, 16 Apr 2019 22:56:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90498840D7; Tue, 16 Apr 2019 22:56:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f67.google.com with SMTP id f6so19063381iop.3; Tue, 16 Apr 2019 15:56:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=41VlXKvpyvUQSkyagsxvTJMsN5lzY6HrHdtrkLoGMx8=; b=RYy/XjI1wV3RLHXZ7JHngF8XeSXySOoghwcyt949OCSy0c1G8jmmZMm0wM5Zp0zZJV SuRpYxdBCxASA57UItW0Nk5J8QK9N00Tjt9Q1nayGLPu2kyh3zlC0acaqNgs7T6oLQMB 9RlJ0NyF2DyyM5y7NTtLT9nLUQkVOZrBBkEpn8h46YcFdiXVbfVe0T+6cnbyYpp8XOSn 6ULp0f3sRviYuXElsZ5lZtmRt01/QWEMnfSwlXCHBGVj/LA0QbxsfE0cN4AY+VKagdzQ BrHmsfxSOKH/+PRSdz7gGUVBd8G279Oj/L0et6+J7sle/nhhjsB7D5JNhPEA4XfxqDp3 6iLA== X-Gm-Message-State: APjAAAXmsJrJ6VBfkdhffIy83KkIHgNpyKlOIP12OQcaYdon8QLKmjSK 1VHqQG5K6JOaq6lc+M0D5Q3Qj0Nv X-Google-Smtp-Source: APXvYqytdlVO3ff9kEMmgd48JJi0LCrW0ZECcg8O5KkPe6FznxkHNxIl8IupFySE+4GYDJZ61nw9uA== X-Received: by 2002:a6b:f317:: with SMTP id m23mr39953939ioh.136.1555454966712; Tue, 16 Apr 2019 15:49:26 -0700 (PDT) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com. [209.85.166.47]) by smtp.gmail.com with ESMTPSA id o203sm390551itd.1.2019.04.16.15.49.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 15:49:26 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id s7so19009243iom.12; Tue, 16 Apr 2019 15:49:26 -0700 (PDT) X-Received: by 2002:a6b:8b90:: with SMTP id n138mr10045058iod.75.1555454966164; Tue, 16 Apr 2019 15:49:26 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> In-Reply-To: <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 15:49:14 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 90498840D7 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 22:56:01 -0000 On Tue, Apr 16, 2019 at 2:32 PM John Baldwin wrote: > There are definitely places arc4random is used where sleeping is not allowed. Sure. > ipsec generating nonces for AES-CBC is one example I can think of off the > top of my head. IVs for AES-CBC are also a great example of a case we should be seeded for. > I think it might be useful to add an explicit WITNESS_WARN > in arc4random to catch these cases so they can be found and reasoned about. Well, we kind of want that, but we also want the warning to disappear if the consumer has correctly reasoned about it. E.g., if the thread has verified seeded status with is_random_seeded(), it is no longer possible for a arc4random consumption to block. Right? I think that may be difficult to integrate with the WITNESS_WARN, so even if all consumers are correctly implemented, we will not eliminate the witness warnings. Do you have any ideas? The only dumb proposal I have is burning a flag in td_flags for "this thread checked is_random_seeded(), and it returned true." > Note that I actually often run into unseeded systems when doing development > using qemu for non-x86 architectures. For example, when booting mips from > qemu, there is no loader, the kernel just starts, and since the endian is > opposite, I frequently regenerate the filesystem using makefs. Right. Perhaps we could incorporate boot/entropy generation into makefs? Or pass host entropy into some kernel accessible region (env var, whatever) via qemu? The latter is sort of a general problem for VMs. You want to be able to snapshot and clone a VM without producing reproducible RNG state, but Fortuna doesn't handle that explicitly (aside from future entropy differences and forward secrecy causing quick divergence). Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 23:03:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D4D1580218; Tue, 16 Apr 2019 23:03:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f196.google.com (mail-it1-f196.google.com [209.85.166.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8219784568; Tue, 16 Apr 2019 23:03:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f196.google.com with SMTP id w15so1501778itc.0; Tue, 16 Apr 2019 16:03:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oG7GaZKB+CcMbCvwNFCxvkj8ZqQAo33dhhD/uuIAOZc=; b=IOs2Oh+OukakBiU3MMdM7suq9yl2IpplTYDGKMuTaCjAzKFxubAaLzRCz7V2K++93Y JX21vLFw6AikUehvTniTwM7B8jRI0BwrG/Qy6OgC0qu4cdcdjLJbfoazGgMaaIVfGVDf BIukekyTlnDAvMxNeF6MtywTAX4l1bUVAaKDKlbpz07F40o2J8DwlOAoix4Gjpj/W3E1 x4F7kBGRaSBsr3FqCCZpVlJfanQJ6EyR8DDWA/Kw2zr2h6Vd8QcPifh3dWvpXKMjTj6n yA1ducvFoFeBLWi/r3sCYJkvVYZveHKogQc6ngNy37U4ZJU6b9Uu3gSZ5T7UsJcVwOjI 3EkQ== X-Gm-Message-State: APjAAAU5tCtoCq7lG3H8eTXD4OndhyMUMFyzm6hfBpDISUqejuCMKvBE HtbUSV1hNSKJn236t4zJtVoOWOjfaDXuqoOn6YbAXOhK X-Google-Smtp-Source: APXvYqwGLqrG6gKhB7RP2bp9N8dXcK7TiMqUJ0Lmt4gmu+0YYpx4l6IhTfB8XfLT/qBORPPW/gBth5IR251ryDdAfT4= X-Received: by 2002:a24:7354:: with SMTP id y81mr32844374itb.87.1555455831515; Tue, 16 Apr 2019 16:03:51 -0700 (PDT) MIME-Version: 1.0 References: <201904160412.x3G4CgN2015092@repo.freebsd.org> <20190416131915.2ocot4nonnf3sl4a@mutt-hbsd> In-Reply-To: From: Ed Maste Date: Tue, 16 Apr 2019 19:03:35 -0400 Message-ID: Subject: Re: svn commit: r346263 - head/contrib/tcpdump To: Conrad Meyer Cc: Shawn Webb , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8219784568 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.960,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, 16 Apr 2019 23:03:59 -0000 On Tue, 16 Apr 2019 at 11:38, Conrad Meyer wrote: > > I don't think documenting that makes much sense in general. It would > be extremely burdensome to fully document and quickly become > desynchronized from the code. It's comparable to OpenBSD pledging > differently in different paths of programs. It's probably worth having tcpdump emit a warning if it's not able to enter capability mode as a result of the options in use, if someone's interested in proposing a patch. From owner-svn-src-head@freebsd.org Tue Apr 16 23:28:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7032515809D1; Tue, 16 Apr 2019 23:28:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1319A852E5; Tue, 16 Apr 2019 23:28:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (unknown [IPv6:2601:648:8880:1e30:50e5:2fcc:d66f:cb37]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 56F4D17853; Tue, 16 Apr 2019 23:28:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <457a2c63-f062-8fc6-15d4-6f5b93981930@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: <5d790a56-1498-094e-6bb4-48345a231e55@FreeBSD.org> Date: Tue, 16 Apr 2019 16:28:45 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1319A852E5 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: Tue, 16 Apr 2019 23:28:48 -0000 On 4/16/19 3:49 PM, Conrad Meyer wrote: > On Tue, Apr 16, 2019 at 2:32 PM John Baldwin wrote: >> There are definitely places arc4random is used where sleeping is not allowed. > > Sure. > >> ipsec generating nonces for AES-CBC is one example I can think of off the >> top of my head. > > IVs for AES-CBC are also a great example of a case we should be seeded for. Yes, but we need some kind of non-blocking API, not an unconditionally-blocking API that deadlocks. >> I think it might be useful to add an explicit WITNESS_WARN >> in arc4random to catch these cases so they can be found and reasoned about. > > Well, we kind of want that, but we also want the warning to disappear > if the consumer has correctly reasoned about it. E.g., if the thread > has verified seeded status with is_random_seeded(), it is no longer > possible for a arc4random consumption to block. Right? I think that > may be difficult to integrate with the WITNESS_WARN, so even if all > consumers are correctly implemented, we will not eliminate the witness > warnings. Do you have any ideas? The only dumb proposal I have is > burning a flag in td_flags for "this thread checked > is_random_seeded(), and it returned true." Eh, I thought that we periodically pulled in new entropy to generate a new chacha20 key for the PRNG and that could be blocking as well when I was last reading this code, or is that not correct? Or maybe arc4random passes in a flag to disable reseeding so it isn't blocking once the PRNG has been seeded at least once? Still, what I would suggest is to have the existing arc4random() use WITNESS_WARN. We could provide an alternative API that is non-blocking and returns EWOULDBLOCK. Code that trips over the warning would have to be changed to use the non-blocking API and then deal with EWOULDBLOCK. One way of dealing with that would be to check the is_random_seeded() flag earlier in the function, subsystem, whatever and then the code could assert that the non-blocking API never failed. >> Note that I actually often run into unseeded systems when doing development >> using qemu for non-x86 architectures. For example, when booting mips from >> qemu, there is no loader, the kernel just starts, and since the endian is >> opposite, I frequently regenerate the filesystem using makefs. > > Right. Perhaps we could incorporate boot/entropy generation into > makefs? Or pass host entropy into some kernel accessible region (env > var, whatever) via qemu? The latter is sort of a general problem for > VMs. You want to be able to snapshot and clone a VM without producing > reproducible RNG state, but Fortuna doesn't handle that explicitly > (aside from future entropy differences and forward secrecy causing > quick divergence). There are things like virtio-rng for modern x86 VM environments, but those don't exist on things like the MIPS MALTA machine. I also don't actually care at all (as in absolutely zero) about the entropy of keys generated for a test qemu instance I fire up on my desktop that doesn't permit inbound access from the outside world. Having some kind of tunable / kernel option for those use cases (that isn't the default) doesn't seem unreasonable. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Apr 16 23:31:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CE6B1580C4E; Tue, 16 Apr 2019 23:31:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10ECD8558F; Tue, 16 Apr 2019 23:31:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (unknown [IPv6:2601:648:8880:1e30:50e5:2fcc:d66f:cb37]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 593D317854; Tue, 16 Apr 2019 23:31:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: rgrimes@freebsd.org Cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> 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: <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@FreeBSD.org> Date: Tue, 16 Apr 2019 16:31:36 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 10ECD8558F 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.984,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: Tue, 16 Apr 2019 23:31:38 -0000 On 4/16/19 3:51 PM, Rodney W. Grimes wrote: >> On 4/15/19 11:40 AM, Conrad Meyer wrote: >> Note that I actually often run into unseeded systems when doing development >> using qemu for non-x86 architectures. For example, when booting mips from >> qemu, there is no loader, the kernel just starts, and since the endian is >> opposite, I frequently regenerate the filesystem using makefs. > > Isnt this also the case for bhyveload? We do not go through the loader > there when we are starting a FreeBSD guest, correct? bhyveload is effectively the loader in this case. It runs the normal loader scripts and logic and so would load the guests's /boot/entropy and pass it to the guest kernel as metadata just like the regular loader. In addition, bhyve also supports virtio-rng which is another way to provide entropy to guest OS's. That's why in my reply I focused on qemu for mips (or riscv) as for x86 hypervisors there are existing, somewhat-standarized solutions for the hypervisor to provide entropy to the guest. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Apr 16 23:43:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A0A61580F62; Tue, 16 Apr 2019 23:43:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 937AB85D0E; Tue, 16 Apr 2019 23:43:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f44.google.com with SMTP id v10so19117088iom.8; Tue, 16 Apr 2019 16:43:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Qy24jlWnhqpQBTPNsTSLPfsDiCMvmd25HGwOVMlFXow=; b=QSTnTOzWQ96bpYpcvz+hidxk7fqq/lwPghJwPt0DP5vwpQ/yeqb3FzFs0QR/F6IAUJ LNupIozUP5aPFIBE+gUarCI/tMm0JkjvWuiSYHDG6ZZnsCilK9pV9OC1wiryKdsh5y6m 5a3fTVNeExJJmMn31g9wEdi/UajxHcQXMogneVWsjhJJN34XR8hJslTxvX8eT2XtQlyc nc0R0af86sCGHx8rzMUqNYELWIZcJGvu5JTs84abSKv44BGY2oXuVUdY43C/BULS5tcZ yKm2e4OUDx+qULQdAczPs20eW5jrliRDGXwEfky/cNHsSKPUoOOcUlrquQinryz6pVH1 gVmA== X-Gm-Message-State: APjAAAUoZQdHAVxZ7AhTkUsCdMarj2XiZfl/ZkvQsh4b5OPT8sVTtEbp 9eFGhljnkjIVV0mbaVrQhsAcgivF X-Google-Smtp-Source: APXvYqwcrj7OtcJRy++5fhmehGD5wFv/J50bH8JjnN/7oAsAwMjVxsLO+PdsyqlvAaIltWC2NnZ3Zw== X-Received: by 2002:a6b:e317:: with SMTP id u23mr3060182ioc.206.1555458220645; Tue, 16 Apr 2019 16:43:40 -0700 (PDT) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com. [209.85.166.51]) by smtp.gmail.com with ESMTPSA id f14sm20181470ion.46.2019.04.16.16.43.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 16:43:40 -0700 (PDT) Received: by mail-io1-f51.google.com with SMTP id u12so19075363iop.11; Tue, 16 Apr 2019 16:43:40 -0700 (PDT) X-Received: by 2002:a6b:8b90:: with SMTP id n138mr10196268iod.75.1555458220164; Tue, 16 Apr 2019 16:43:40 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> <5d790a56-1498-094e-6bb4-48345a231e55@FreeBSD.org> In-Reply-To: <5d790a56-1498-094e-6bb4-48345a231e55@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 16:43:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 937AB85D0E 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.973,0]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 23:43:48 -0000 On Tue, Apr 16, 2019 at 4:28 PM John Baldwin wrote: > Yes, but we need some kind of non-blocking API, not an unconditionally-blocking API > that deadlocks. I'm not sure we do. It would be sufficient to check once at subsystem initialization time. There's no race condition such that we block again once we're seeded. As far as APIs go, read_random_uio is nonblocking, although not an arc4random interface (and quite cumbersome to set up and use). > Eh, I thought that we periodically pulled in new entropy to generate a new chacha20 > key for the PRNG and that could be blocking as well when I was last reading this > code, or is that not correct? No, that's incorrect. We periodically pull new Fortuna (devrandom) output to reseed chacha20 in arc4random, but once Fortuna is "seeded," it *never* blocks ever again. > Or maybe arc4random passes in a flag to disable > reseeding so it isn't blocking once the PRNG has been seeded at least once? As above, *re*seeding arc4random never blocks. > Still, what I would suggest is to have the existing arc4random() use WITNESS_WARN. > We could provide an alternative API that is non-blocking and returns EWOULDBLOCK. I think the alternative EWOULDBLOCK proposal is worse than WITNESS_WARN. But I highlighted some problems with WITNESS_WARN in my earlier email; how would you resolve them? > Code that trips over the warning would have to be changed to use the non-blocking > API and then deal with EWOULDBLOCK. Or it could just check that the random device is seeded, prior to using arc4random? > One way of dealing with that would be to > check the is_random_seeded() flag earlier in the function, subsystem, whatever > and then the code could assert that the non-blocking API never failed. That's more or less the status quo with no-error arc4random, no? > There are things like virtio-rng for modern x86 VM environments, but those don't > exist on things like the MIPS MALTA machine. They probably probe later than SI_SUB_RANDOM too :-(. > I also don't actually care at all (as in > absolutely zero) about the entropy of keys generated for a test qemu instance I fire up > on my desktop that doesn't permit inbound access from the outside world. Having some > kind of tunable / kernel option for those use cases (that isn't the default) doesn't > seem unreasonable. Sure. It would probably be ok to have a knob for that. We would want to be careful about naming it / documenting it; the thing about knobs is people tend to twiddle them. Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 16 23:48:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F36D81581026; Tue, 16 Apr 2019 23:48:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7775F85F15; Tue, 16 Apr 2019 23:48:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f52.google.com with SMTP id b6so19153012iog.0; Tue, 16 Apr 2019 16:48:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=odsmj96NJ8JIboVrXKLUZGaYvkbPGNeAHxbHowzjxSo=; b=IIb1kBkiqMiHD73R9TruFp6SKYGLMPKipmukfk4kFfdiTQ/fsDEFO5XtqDFVjL45Cr zIPWCGUGwBtYChbxE3Ni2HqVUvIu9IkMhy1fyUdcrcbd8Vcx0qm39WhqYeDnRA7eeK/v K8OxXGlozmfXOBLCtbpATB+3UJpsxTWXgeG8Q72diHvyib1VAoNyi6VeLLGLbp6hPpdt hQ3xoXzk9BTaFOcodn9KRI7zLqpPdWxU3QLkUNdS0qn8MUxrAcELhNiJqzSo2rqz1rpf ryItnMRQDkXzK4C1p+eDXYj+XDNcZCkf+34ny/3rCT1ro1kzVhWlpXrD4F97SV4VEX/Z rlWQ== X-Gm-Message-State: APjAAAX9d9yzIRzaB1t7sZn5Up5X/JZzAqSZUy1XdGf3FKlmh5ExLiBS D0dw8puJb28Sc4JHDCRzTPo7lYC3 X-Google-Smtp-Source: APXvYqyaJUvTbMwg6wOfQgPC9ZYter30Zg52gJBMCqoLKc7V6fjsM1TkD6Z7FaSCNSUA4H6fWy4pwQ== X-Received: by 2002:a5d:97da:: with SMTP id k26mr54184971ios.46.1555458507391; Tue, 16 Apr 2019 16:48:27 -0700 (PDT) Received: from mail-it1-f170.google.com (mail-it1-f170.google.com. [209.85.166.170]) by smtp.gmail.com with ESMTPSA id c13sm19915342iod.88.2019.04.16.16.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 16:48:26 -0700 (PDT) Received: by mail-it1-f170.google.com with SMTP id y134so1641479itc.5; Tue, 16 Apr 2019 16:48:26 -0700 (PDT) X-Received: by 2002:a05:660c:111:: with SMTP id w17mr32299105itj.62.1555458506488; Tue, 16 Apr 2019 16:48:26 -0700 (PDT) MIME-Version: 1.0 References: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@FreeBSD.org> In-Reply-To: <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 16 Apr 2019 16:48:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7775F85F15 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.972,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Tue, 16 Apr 2019 23:48:29 -0000 On Tue, Apr 16, 2019 at 4:31 PM John Baldwin wrote: > bhyveload is effectively the loader in this case. It runs the normal loader > scripts and logic and so would load the guests's /boot/entropy and pass it > to the guest kernel as metadata just like the regular loader. Right, except it doesn't seem to do things like nuke /boot/nextboot.conf :-(. > In addition, bhyve also supports virtio-rng which is another way to provide > entropy to guest OS's. That's why in my reply I focused on qemu for mips > (or riscv) as for x86 hypervisors there are existing, somewhat-standarized > solutions for the hypervisor to provide entropy to the guest. Perhaps cryptographically random stack-protector cookies are simply inappropriate for MIPS or RISCV. Do we have any other examples of kernel random consumers blocking after that immediate hiccup is overcome? Best, Conrad From owner-svn-src-head@freebsd.org Wed Apr 17 03:29:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B3C1584E35; Wed, 17 Apr 2019 03:29:17 +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 868308C6D7; Wed, 17 Apr 2019 03:29:17 +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 637D8139B; Wed, 17 Apr 2019 03:29:17 +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 x3H3THsH054320; Wed, 17 Apr 2019 03:29:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3H3TGZp054318; Wed, 17 Apr 2019 03:29:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904170329.x3H3TGZp054318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 17 Apr 2019 03:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346307 - in head: share/man/man4 sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: share/man/man4 sys/conf X-SVN-Commit-Revision: 346307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 868308C6D7 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]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 17 Apr 2019 03:29:18 -0000 Author: kevans Date: Wed Apr 17 03:29:16 2019 New Revision: 346307 URL: https://svnweb.freebsd.org/changeset/base/346307 Log: fdt: further consolidate DTB building and revise manpage FDT_DTS_FILE was built separately with a rule in sys/conf/files and recreated the rules we used in dtb.mk. Now that we have other infrastructure to build a DTB along with the kernel, fold FDT_DTS_FILE into that since it doesn't have any special requirements. fdt(4) never got revised to mention the DTS/DTSO make options, so do that now. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19736 Modified: head/share/man/man4/fdt.4 head/sys/conf/files head/sys/conf/kern.post.mk Modified: head/share/man/man4/fdt.4 ============================================================================== --- head/share/man/man4/fdt.4 Tue Apr 16 23:08:54 2019 (r346306) +++ head/share/man/man4/fdt.4 Wed Apr 17 03:29:16 2019 (r346307) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 12, 2010 +.Dd March 28, 2019 .Dt FDT 4 .Os .Sh NAME @@ -139,6 +139,21 @@ support at the .Fx kernel level. .Bl -tag -width Ar +.It Va makeoptions DTS+=.dts +Specifies device tree source (DTS) files for a given kernel. +The indicated DTS files will be converted (compiled) into a binary form +along with building the kernel itself. +Any DTS file names not written as an absolute path must be specified relative +to the default location of DTS sources i.e., +.Pa sys/dts . +.It Va makeoptions DTSO+=.dtso +Specifies device tree source overlay (DTSO) files for a given kernel. +Overlay files will be built with the kernel as with the makeoption +.Va DTS +described above. +Overlay files specified as relative paths will be relative to the default +location of DTS overlays for the platform being built i.e., +.Pa sys/dts/arm/overlays . .It Va options FDT The primary option for enabling .Nm @@ -153,10 +168,9 @@ drivers, as well as helper routines and libraries. .It Va makeoptions FDT_DTS_FILE=.dts Specifies a preferred (default) device tree source (DTS) file for a given kernel. -The indicated DTS file will be converted (compiled) into a binary form -along with building the kernel itself. -The DTS file name is relative to the default location of DTS sources i.e. -.Pa sys/dts . +It will be built along with the kernel as if it were supplied via the makeoption +.Va DTS +described above. This makeoption is not mandatory unless FDT_DTB_STATIC is also defined (see below). .It Va options FDT_DTB_STATIC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Apr 16 23:08:54 2019 (r346306) +++ head/sys/conf/files Wed Apr 17 03:29:16 2019 (r346307) @@ -19,17 +19,9 @@ bhnd_nvram_map_data.h optional bhnd \ compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \ no-obj no-implicit-rule before-depend \ clean "bhnd_nvram_map_data.h" -# -# The 'fdt_dtb_file' target covers an actual DTB file name, which is derived -# from the specified source (DTS) file: .dts -> .dtb -# -fdt_dtb_file optional fdt fdt_dtb_static \ - compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}'" \ - no-obj no-implicit-rule before-depend \ - clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}'" \ - dependency "fdt_dtb_file" \ + dependency "${FDT_DTS_FILE:T:R}.dtb" \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" feeder_eq_gen.h optional sound \ @@ -1723,7 +1715,7 @@ dev/fdt/fdt_pinctrl.c optional fdt fdt_pinctrl dev/fdt/fdt_pinctrl_if.m optional fdt fdt_pinctrl dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand | fdt mx25l | fdt n25q | fdt at45d dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ - dependency "fdt_dtb_file" + dependency "${FDT_DTS_FILE:T:R}.dtb" dev/fdt/simplebus.c optional fdt dev/fdt/simple_mfd.c optional fdt dev/fe/if_fe.c optional fe Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Apr 16 23:08:54 2019 (r346306) +++ head/sys/conf/kern.post.mk Wed Apr 17 03:29:16 2019 (r346307) @@ -8,6 +8,9 @@ # should be defined in the kern.pre.mk so that port makefiles can # override or augment them. +.if !empty(FDT_DTS_FILE) +DTS+= ${FDT_DTS_FILE} +.endif .if defined(DTS) || defined(DTSO) .include "dtb.build.mk" From owner-svn-src-head@freebsd.org Wed Apr 17 09:23:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A67158BAB7; Wed, 17 Apr 2019 09:23:57 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id C25C06FE5B; Wed, 17 Apr 2019 09:23:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [192.168.1.41] (89.red-88-7-96.staticip.rima-tde.net [88.7.96.89]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 142F74E63E; Wed, 17 Apr 2019 09:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1555492997; bh=mOyOTV5mUWq5MENqjLxytMasBh/+9s3Lsmm+JgTXJTg=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=ARN3PVD0O9RyHZwfNMZDYZH/YHfrNr9HWl4H2aglhXhl19oVbC+KPzDrMmC2xn4zQ MIdEIpu5GCBNGb4LERlgttLECRp6O16Pr2cFD3uAwzKhML6ouD9LAFlh1zghs0X4UI s2etPHkk8gNeXcKqNLW3kCWbuTzT50Q7DppZdLCLoTSRChHaW1RzLbS9UeAQorLzIM 0XmYxAHyxZbYRBNYUAzQA6PFp1fIcqk76NyyQbaH6S7PRPU8oSALW8/CapDz2c6Ble KCnGtSGlPYm5TyS3f4nJtCEUt/7X1kyCPBXvAYNnwHGhxaVQV1jG8uZb6MVc5wtM8Y 3iutcJNKoJGGg5BF5v4JSs44jdKQ9SH1G+l0enodftP3X/40TlaSlEFx5sD77/GZ13 moJZdoSoDYaLRUjbhjkQzkvEAR1GgjvtNiKMNhALMTTJoxhd6OrjkQ/JW4xtlTLVbW Ff49rPPPjaYkR0Gk2x/fSlEVi+9AvsYP9Pkoponxcl42mfOk/OUc1xYnwftY4KzOQi DAXjopISQ5Hba+GesgX4rRLKZ1Lscz92HOj0d7foITe5Kp7IpXIHaJ53Min5q3CjW7 kH6j/VybygcxQIXss8fpZSwJuNuwamGFgFcPznmLn+WGM3vTlHS+E11nqaTsg8nUhW +P18laAttgCFqYQ6qrrfnYQg= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r346295 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124 a... From: Andrew Turner In-Reply-To: <201904162004.x3GK4N7u019636@repo.freebsd.org> Date: Wed, 17 Apr 2019 11:23:15 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201904162004.x3GK4N7u019636@repo.freebsd.org> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: C25C06FE5B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,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: Wed, 17 Apr 2019 09:23:57 -0000 > On 16 Apr 2019, at 22:04, Emmanuel Vadot wrote: >=20 > Author: manu > Date: Tue Apr 16 20:04:22 2019 > New Revision: 346295 > URL: https://svnweb.freebsd.org/changeset/base/346295 >=20 > Log: > arm: Add kern_clocksource.c directly in files.arm >=20 > This files is needed and included in all our config so move it to a = common > location. >=20 > MFC after: 2 weeks ... > Modified: head/sys/conf/files.arm > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/files.arm Tue Apr 16 19:46:02 2019 = (r346294) > +++ head/sys/conf/files.arm Tue Apr 16 20:04:22 2019 = (r346295) > @@ -11,6 +11,9 @@ cloudabi32_vdso_blob.o optional = compat_cloudabi32 \ > no-implicit-rule = \ > clean "cloudabi32_vdso_blob.o" > # > + > +kern/kern_clocksource.c standard Could this be moved from the various files.* to files? It seems we = define it as standard on all architectures. Andrew From owner-svn-src-head@freebsd.org Wed Apr 17 14:12:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C02156D207; Wed, 17 Apr 2019 14:12:12 +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 AF41881079; Wed, 17 Apr 2019 14:12:11 +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 89F49840D; Wed, 17 Apr 2019 14:12:11 +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 x3HECBYK094896; Wed, 17 Apr 2019 14:12:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HECBg7094895; Wed, 17 Apr 2019 14:12:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201904171412.x3HECBg7094895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 17 Apr 2019 14:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346310 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 346310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF41881079 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)[-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: Wed, 17 Apr 2019 14:12:12 -0000 Author: pfg Date: Wed Apr 17 14:12:11 2019 New Revision: 346310 URL: https://svnweb.freebsd.org/changeset/base/346310 Log: Add myself to ports committers. Approved by: pfg (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Wed Apr 17 12:34:37 2019 (r346309) +++ head/share/misc/committers-ports.dot Wed Apr 17 14:12:11 2019 (r346310) @@ -213,6 +213,7 @@ pat [label="Patrick Li\npat@FreeBSD.org\n2001/11/14"] pav [label="Pav Lucistnik\npav@FreeBSD.org\n2003/11/12"] pawel [label="Pawel Pekala\npawel@FreeBSD.org\n2011/03/11"] pclin [label="Po-Chien Lin\npclin@FreeBSD.org\n2013/02/11"] +pfg [label="Pedro Giffuni\npfg@FreeBSD.org\n2019/04/14"] pgj [label="Gabor Pali\npgj@FreeBSD.org\n2009/04/12"] pgollucci [label="Philip M. Gollucci\npgollucci@FreeBSD.org\n2008/07/21"] philip [label="Philip Paeps\nphilip@FreeBSD.org\n2005/10/19"] @@ -727,6 +728,7 @@ tcberner -> pkubaj thierry -> jadawin thierry -> riggs +thierry -> pfg timur -> kbowling From owner-svn-src-head@freebsd.org Wed Apr 17 14:20:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FF6F156D72E; Wed, 17 Apr 2019 14:20:56 +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 DB0E1815B9; Wed, 17 Apr 2019 14:20:55 +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 B6AD88468; Wed, 17 Apr 2019 14:20:55 +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 x3HEKtlx096422; Wed, 17 Apr 2019 14:20:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HEKtd0096421; Wed, 17 Apr 2019 14:20:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201904171420.x3HEKtd0096421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 17 Apr 2019 14:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346311 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 346311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB0E1815B9 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.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 14:20:56 -0000 Author: pfg Date: Wed Apr 17 14:20:55 2019 New Revision: 346311 URL: https://svnweb.freebsd.org/changeset/base/346311 Log: Add orphan mentee. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Apr 17 14:12:11 2019 (r346310) +++ head/share/misc/committers-src.dot Wed Apr 17 14:20:55 2019 (r346311) @@ -743,6 +743,7 @@ obrien -> gshapiro obrien -> kan obrien -> sam +pfg -> pstef pfg -> fsu peter -> asmodai From owner-svn-src-head@freebsd.org Wed Apr 17 14:24:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5E95156D88E; Wed, 17 Apr 2019 14:24:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87DE881B71; Wed, 17 Apr 2019 14:24:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id ED2EA1DBA6; Wed, 17 Apr 2019 14:24:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r346310 - head/share/misc From: Pedro Giffuni To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904171412.x3HECBg7094895@repo.freebsd.org> Organization: FreeBSD Message-ID: <196fba6c-a9b6-6c99-1774-9cac36fd8bef@FreeBSD.org> Date: Wed, 17 Apr 2019 09:24:53 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201904171412.x3HECBg7094895@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 87DE881B71 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.989,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: Wed, 17 Apr 2019 14:24:57 -0000 On 2019-04-17 09:12, Pedro F. Giffuni wrote: > Author: pfg > Date: Wed Apr 17 14:12:11 2019 > New Revision: 346310 > URL: https://svnweb.freebsd.org/changeset/base/346310 > > Log: > Add myself to ports committers. > > Approved by: pfg (mentor) Oops:  I meant thierry (mentor) yikes! Pedro. From owner-svn-src-head@freebsd.org Wed Apr 17 15:27:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22C90156F8E9; Wed, 17 Apr 2019 15:27:12 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B5CC184666; Wed, 17 Apr 2019 15:27:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6715901E; Wed, 17 Apr 2019 15:27:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HFRBkk033627; Wed, 17 Apr 2019 15:27:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HFRBHD033626; Wed, 17 Apr 2019 15:27:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904171527.x3HFRBHD033626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 17 Apr 2019 15:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346312 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 346312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5CC184666 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.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 17 Apr 2019 15:27:12 -0000 Author: ian Date: Wed Apr 17 15:27:11 2019 New Revision: 346312 URL: https://svnweb.freebsd.org/changeset/base/346312 Log: Only set up the interrupts that will actually be used in arm generic_timer. The code previously set up interrupt handlers for all the interrupt resources available, including for timers that are not in use. That could lead to interrupt storms. For example, if boot firmware enabled the virtual timer but the kernel is using the physical timer, it could get flooded with interrupts on the virtual timer which it cannot shut off. By only setting up an interrupt handler for the hardware that will actually be used, any interrupts from other timer units will remain masked in the interrupt controller. Differential Revision: https://reviews.freebsd.org/D19871 Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed Apr 17 14:20:55 2019 (r346311) +++ head/sys/arm/arm/generic_timer.c Wed Apr 17 15:27:11 2019 (r346312) @@ -393,7 +393,7 @@ arm_tmr_attach(device_t dev) pcell_t clock; #endif int error; - int i; + int i, first_timer, last_timer; sc = device_get_softc(dev); if (arm_tmr_sc) @@ -433,17 +433,25 @@ arm_tmr_attach(device_t dev) return (ENXIO); } -#ifdef __arm__ - sc->physical = true; -#else /* __aarch64__ */ - /* If we do not have a virtual timer use the physical. */ - sc->physical = (sc->res[2] == NULL) ? true : false; +#ifdef __aarch64__ + /* Use the virtual timer if we have one. */ + if (sc->res[2] != NULL) { + sc->physical = false; + first_timer = 2; + last_timer = 2; + } else #endif + /* Otherwise set up the secure and non-secure physical timers. */ + { + sc->physical = true; + first_timer = 0; + last_timer = 1; + } arm_tmr_sc = sc; /* Setup secure, non-secure and virtual IRQs handler */ - for (i = 0; i < 3; i++) { + for (i = first_timer; i <= last_timer; i++) { /* If we do not have the interrupt, skip it. */ if (sc->res[i] == NULL) continue; From owner-svn-src-head@freebsd.org Wed Apr 17 15:48:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 338ED1570251; Wed, 17 Apr 2019 15:48:34 +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 C6060852F8; Wed, 17 Apr 2019 15:48:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 984CE93BD; Wed, 17 Apr 2019 15:48:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HFmXZm043821; Wed, 17 Apr 2019 15:48:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HFmXHL043820; Wed, 17 Apr 2019 15:48:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171548.x3HFmXHL043820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 15:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346313 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 346313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6060852F8 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,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, 17 Apr 2019 15:48:34 -0000 Author: emaste Date: Wed Apr 17 15:48:33 2019 New Revision: 346313 URL: https://svnweb.freebsd.org/changeset/base/346313 Log: cap_fileargs.3: correct 'filerags' typo Submitted by: Bora Özarslan" MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 15:27:11 2019 (r346312) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 15:48:33 2019 (r346313) @@ -120,7 +120,7 @@ For details see The .Fa fileargs_free close connection to the -.Nm system.filerags +.Nm system.fileargs service and free are structures. The function handle .Dv NULL @@ -139,7 +139,7 @@ expect that all arguments are fetched from the structure. .Sh LIMITS This section describe which values and types should be used to pass arguments to the -.Fa system.filerags +.Fa system.fileargs through the .Fn fileargs_ininv and @@ -181,7 +181,7 @@ Any number of where the name of the element is name of the file which can be opened. .Sh EXAMPLES The following example first parse some options and then create the -.Nm system.filerags +.Nm system.fileargs service with remaining arguments. .Bd -literal int ch, fd, i; From owner-svn-src-head@freebsd.org Wed Apr 17 15:52:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E31615704DA for ; Wed, 17 Apr 2019 15:52:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B89785708 for ; Wed, 17 Apr 2019 15:52:37 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555516355; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=aCP53Qgh/giSIkHqAcqNUdo4JNHZZytTuzIu60Y85pq/TPsDjvcQQKt5KjvAgE5WNTr83pGhf6uqI 3mHNY6xqjrDCj72NFlKz7+X6dgvN/aYpg2pCbrA0FSFn8qcLpaN4izDpmLZVywulumKlzhy1QRyWzM 0tWZZjxPPPt/rdbN6ZvM11VlVcBEwWmW6cqJeaek94TzQ7/ySvCfPVIlz2CO92pA1c43EaPVCPFrUm T1DSMFwHxZkpriv0HBnSeKz+97yjGmi04wQbhQC2faIv3ms1WcAFJQ/CdpGrm+/wRqZU83yX0WjbnW 5i6xHBCUyqYloqQ0vlc2t89Bp/nl0Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=e7EdNozgG2arNfOnQbdc0e1ECcjHv54+1OZaKkc4OOM=; b=mXxx2C4nv80cwjW3DTlfl5XXAbAPs4QImcluk6TirSfJOjZlvpWo6lCK92jujKm9cCj+g/IW9s1KI s4pc/6gOo9PoWYyHVu01yKz9J2mcVdRvp5kampDdeiYccX9iJXlITF35U3s/lKmLOOtQyW5cJ1BRlW psxj+o41gO7W5UDdM4hZRRlGxBgYNyJ+APuJxPbagLvzDC9JyhiD+J+w6f9szG8rn/wIElfVJsnmZS Nm1GZCcsL8CBowqkN2aXnhJyJGDgDwJEu/bG5b+qXhtLiS6H6ZH7ACRLx3mrlCHdRXYM7OwOnu2mvp f2iXQuYxi4zLGXh6iNI5arFoQ53VyAA== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=e7EdNozgG2arNfOnQbdc0e1ECcjHv54+1OZaKkc4OOM=; b=VwA9lxsYJX7O3FRioyP/UqbV7cnLtlesVrGAkRnXxm6gTe37BRrpFTlWn7EkplRlwMza94TyApOTY LypnSpILK8RhKHMcbj786mk4k9h93A0SStIl0USvD99T1XuBiLBwryjuciVz28LoG8HAayjzqEEIl7 xvrzloWtja8xXU87fJ6nzPQ07eF+E1UtipbH2BVdAtQw+fnAOp06uXCjRPp6C7Ygpidx2f+p+3VMF4 UTwKC9pK/6OSWAikRJUuR6ze6H2MLlqKF7nRppORJHx4v2dXu76f3Geo957En58h9i3XQYJ6sPlkX3 8QzDUwn5uCtSlCQzIzR5lyCTCiRaI/g== X-MHO-RoutePath: aGlwcGll X-MHO-User: cf587f98-6128-11e9-919f-112c64a8cf29 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id cf587f98-6128-11e9-919f-112c64a8cf29; Wed, 17 Apr 2019 15:52:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3HFqVOa046893; Wed, 17 Apr 2019 09:52:31 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r346295 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124 a... From: Ian Lepore To: Andrew Turner , Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 17 Apr 2019 09:52:31 -0600 In-Reply-To: References: <201904162004.x3GK4N7u019636@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6B89785708 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.990,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: Wed, 17 Apr 2019 15:52:38 -0000 On Wed, 2019-04-17 at 11:23 +0200, Andrew Turner wrote: > > On 16 Apr 2019, at 22:04, Emmanuel Vadot wrote: > > > > Author: manu > > Date: Tue Apr 16 20:04:22 2019 > > New Revision: 346295 > > URL: https://svnweb.freebsd.org/changeset/base/346295 > > > > Log: > > arm: Add kern_clocksource.c directly in files.arm > > > > This files is needed and included in all our config so move it to > > a common > > location. > > > > MFC after: 2 weeks > > ... > > Modified: head/sys/conf/files.arm > > =================================================================== > > =========== > > --- head/sys/conf/files.arm Tue Apr 16 19:46:02 2019 (r346294) > > +++ head/sys/conf/files.arm Tue Apr 16 20:04:22 2019 (r346295) > > @@ -11,6 +11,9 @@ cloudabi32_vdso_blob.o optional com > > pat_cloudabi32 \ > > no-implicit-rule \ > > clean "cloudabi32_vdso_blob.o" > > # > > + > > +kern/kern_clocksource.c standard > > Could this be moved from the various files.* to files? It seems we > define it as standard on all architectures. > > I thought mips still had some variants that didn't implement event timers. That's why this stuff was ever in arch-specific files, arm and mips had some flavors without ET support. If we no longer have any platforms that need to run without event timers, there is some more extensive cleanup that could be done beyond just moving this entry to sys/conf/files (and I'd be up for doing that work, if I can find time). -- Ian From owner-svn-src-head@freebsd.org Wed Apr 17 16:00:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E72ED157076A; Wed, 17 Apr 2019 16:00:34 +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 8845285ABD; Wed, 17 Apr 2019 16:00:34 +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 63AF49571; Wed, 17 Apr 2019 16:00:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HG0Y75049410; Wed, 17 Apr 2019 16:00:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HG0Ych049409; Wed, 17 Apr 2019 16:00:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171600.x3HG0Ych049409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 16:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346314 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 346314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8845285ABD 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.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 16:00:35 -0000 Author: emaste Date: Wed Apr 17 16:00:33 2019 New Revision: 346314 URL: https://svnweb.freebsd.org/changeset/base/346314 Log: cap_fileargs.3: typo and markup corrections Submitted by: Bora Özarslan" MFC after: 1 week MFC with: r346313 Sponsored by: The FreeBSD Foundation Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 15:48:33 2019 (r346313) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 16:00:33 2019 (r346314) @@ -105,9 +105,9 @@ is equivalent to except that the connection to the Casper needs to be provided. .Pp The functions -.Fn fileargs_ininv +.Fn fileargs_initnv and -.Fn fileargs_cininv +.Fn fileargs_cinitnv are respectively equivalent to .Fn fileargs_init and @@ -141,9 +141,9 @@ structure. This section describe which values and types should be used to pass arguments to the .Fa system.fileargs through the -.Fn fileargs_ininv +.Fn fileargs_initnv and -.Fn fileargs_cinit +.Fn fileargs_cinitnv functions. The .Xr nvlist 9 @@ -225,8 +225,8 @@ fileargs_free(fa); .Xr open 2 , .Xr cap_rights_init 3 , .Xr err 3 , -.Xr fopen 3, -.Xr getopt 3, +.Xr fopen 3 , +.Xr getopt 3 , .Xr capsicum 4 , .Xr nv 9 .Sh BUGS From owner-svn-src-head@freebsd.org Wed Apr 17 16:01:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C14C415707F0; Wed, 17 Apr 2019 16:01:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65B5285CF7; Wed, 17 Apr 2019 16:01:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id B8A231E59C; Wed, 17 Apr 2019 16:01:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> <5d790a56-1498-094e-6bb4-48345a231e55@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: <383a21de-9a7a-2d06-1673-001e84af67f9@FreeBSD.org> Date: Wed, 17 Apr 2019 09:01:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 65B5285CF7 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.978,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: Wed, 17 Apr 2019 16:01:47 -0000 On 4/16/19 4:43 PM, Conrad Meyer wrote: > On Tue, Apr 16, 2019 at 4:28 PM John Baldwin wrote: >> Still, what I would suggest is to have the existing arc4random() use WITNESS_WARN. >> We could provide an alternative API that is non-blocking and returns EWOULDBLOCK. > > I think the alternative EWOULDBLOCK proposal is worse than > WITNESS_WARN. But I highlighted some problems with WITNESS_WARN in my > earlier email; how would you resolve them? > >> Code that trips over the warning would have to be changed to use the non-blocking >> API and then deal with EWOULDBLOCK. > > Or it could just check that the random device is seeded, prior to > using arc4random? You're missing the point which is that you've added potential blocking in a lot of places by changing the semantics of arc4random. Unless you're intending to hand-audit all of them (as well as future uses), I think having the existing API be "safe" (and blocking) but use WITNESS_WARN is a way to catch existing and future locking problems. The EWOULDBLOCK API is something a developer would choose and it means they would be aware of the constraint and need to deal with it, either by handling EWOULDBLOCK in some way, or deferring use until seeded, etc. >> One way of dealing with that would be to >> check the is_random_seeded() flag earlier in the function, subsystem, whatever >> and then the code could assert that the non-blocking API never failed. > > That's more or less the status quo with no-error arc4random, no? Except that we don't know which existing or future uses of arc4random need this unless you manually audit all of them (which doesn't help future uses). -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 17 16:02:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B0F815709EC; Wed, 17 Apr 2019 16:02:59 +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 AA73386007; Wed, 17 Apr 2019 16:02:58 +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 8029E970C; Wed, 17 Apr 2019 16:02:58 +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 x3HG2wUK054378; Wed, 17 Apr 2019 16:02:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HG2wQq054372; Wed, 17 Apr 2019 16:02:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171602.x3HG2wQq054372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 16:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 346315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA73386007 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)[-1.000,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: Wed, 17 Apr 2019 16:02:59 -0000 Author: emaste Date: Wed Apr 17 16:02:57 2019 New Revision: 346315 URL: https://svnweb.freebsd.org/changeset/base/346315 Log: cap_fileargs: add fileargs_lstat service Add fileargs_lstat function to cap_fileargs casper service to be able to lstat files while in capability mode. It can only lstat files given in fileargs_init. Submitted by: Bora Özarslan Reviewed by: oshogbo, cem (partial) MFC after: 3 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19548 Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 head/lib/libcasper/services/cap_fileargs/cap_fileargs.c head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 16:00:33 2019 (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.3 Wed Apr 17 16:02:57 2019 (r346315) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd April 17, 2019 .Dt CAP_FILEARGS 3 .Os .Sh NAME @@ -33,6 +33,7 @@ .Nm fileargs_init , .Nm fileargs_initnv , .Nm fileargs_free , +.Nm fileargs_lstat , .Nm fileargs_open , .Nm fileargs_fopen .Nd "library for handling files in capability mode" @@ -43,9 +44,9 @@ .In libcasper.h .In casper/cap_fileargs.h .Ft "fileargs_t *" -.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" +.Fn fileargs_init "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" "int operations" .Ft "fileargs_t *" -.Fn fileargs_cinit "cap_channel_t *cas" "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" +.Fn fileargs_cinit "cap_channel_t *cas" "int argc" "char *argv[]" "int flags" "mode_t mode" "cap_rights_t *rightsp" "int operations" .Ft "fileargs_t *" .Fn fileargs_cinitnv "cap_channel_t *cas" "nvlist_t *limits" .Ft "fileargs_t *" @@ -53,6 +54,8 @@ .Ft "void" .Fn fileargs_free "fileargs_t *fa" .Ft "int" +.Fn fileargs_lstat "fileargs_t *fa" "const char *path" "struct stat *sb" +.Ft "int" .Fn fileargs_open "fileargs_t *fa" "const char *name" .Ft "FILE *" .Fn fileargs_fopen "fileargs_t *fa" "const char *name" "const char *mode" @@ -97,6 +100,22 @@ The argument contains a list of the capability rights which file should be limited to. For more details of the capability rights see .Xr cap_rights_init 3 . +The +.Fa operations +argument limits the operations that are available using +.Nm system.fileargs . +.Fa operations +is a combination of: +.Bl -ohang -offset indent +.It FA_OPEN +Allow +.Fn fileargs_open +and +.Fn fileargs_fopen . +.It FA_LSTAT +Allow +.Fn fileargs_lstat . +.El .Pp The function .Fn fileargs_cinit @@ -126,6 +145,11 @@ The function handle .Dv NULL argument. .Pp +The function +.Fn fileargs_lstat +is equivalent to +.Xr lstat 2 . +.Pp The functions .Fn fileargs_open and @@ -165,6 +189,15 @@ must contain the The .Va mode argument tells which what mode file should be created. +.It operations (NV_TYPE_NUMBER) +The +.Va operations +limits the usable operations for +.Fa system.fileargs . +The possible values are explained as +.Va operations +argument with +.Fn fileargs_init . .El .Pp The @@ -201,7 +234,7 @@ argv += optind; /* Create capability to the system.fileargs service. */ fa = fileargs_init(argc, argv, O_RDONLY, 0, - cap_rights_init(&rights, CAP_READ)); + cap_rights_init(&rights, CAP_READ), FA_OPEN); if (fa == NULL) err(1, "unable to open system.fileargs service"); @@ -222,6 +255,7 @@ fileargs_free(fa); .Ed .Sh SEE ALSO .Xr cap_enter 2 , +.Xr lstat 2 , .Xr open 2 , .Xr cap_rights_init 3 , .Xr err 3 , Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 16:00:33 2019 (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 16:02:57 2019 (r346315) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -59,8 +60,37 @@ struct fileargs { }; static int -fileargs_get_cache(fileargs_t *fa, const char *name) +fileargs_get_lstat_cache(fileargs_t *fa, const char *name, struct stat *sb) { + const nvlist_t *nvl; + size_t size; + const void *buf; + + assert(fa != NULL); + assert(fa->fa_magic == FILEARGS_MAGIC); + assert(name != NULL); + + if (fa->fa_cache == NULL) + return (-1); + + nvl = dnvlist_get_nvlist(fa->fa_cache, name, NULL); + if (nvl == NULL) + return (-1); + + if (!nvlist_exists_binary(nvl, "stat")) { + return (-1); + } + + buf = nvlist_get_binary(nvl, "stat", &size); + assert(size == sizeof(*sb)); + memcpy(sb, buf, size); + + return (0); +} + +static int +fileargs_get_fd_cache(fileargs_t *fa, const char *name) +{ int fd; const nvlist_t *nvl; nvlist_t *tnvl; @@ -80,6 +110,12 @@ fileargs_get_cache(fileargs_t *fa, const char *name) return (-1); tnvl = nvlist_take_nvlist(fa->fa_cache, name); + + if (!nvlist_exists_descriptor(tnvl, "fd")) { + nvlist_destroy(tnvl); + return (-1); + } + fd = nvlist_take_descriptor(tnvl, "fd"); nvlist_destroy(tnvl); @@ -102,7 +138,7 @@ fileargs_set_cache(fileargs_t *fa, nvlist_t *nvl) } static nvlist_t* -fileargs_fetch(fileargs_t *fa, const char *name) +fileargs_fetch(fileargs_t *fa, const char *name, const char *cmd) { nvlist_t *nvl; int serrno; @@ -111,7 +147,7 @@ fileargs_fetch(fileargs_t *fa, const char *name) assert(name != NULL); nvl = nvlist_create(NV_FLAG_NO_UNIQUE); - nvlist_add_string(nvl, "cmd", "open"); + nvlist_add_string(nvl, "cmd", cmd); nvlist_add_string(nvl, "name", name); nvl = cap_xfer_nvlist(fa->fa_chann, nvl); @@ -130,7 +166,7 @@ fileargs_fetch(fileargs_t *fa, const char *name) static nvlist_t * fileargs_create_limit(int argc, const char * const *argv, int flags, - mode_t mode, cap_rights_t *rightsp) + mode_t mode, cap_rights_t *rightsp, int operations) { nvlist_t *limits; int i; @@ -140,6 +176,7 @@ fileargs_create_limit(int argc, const char * const *ar return (NULL); nvlist_add_number(limits, "flags", flags); + nvlist_add_number(limits, "operations", operations); if (rightsp != NULL) { nvlist_add_binary(limits, "cap_rights", rightsp, sizeof(*rightsp)); @@ -172,7 +209,7 @@ fileargs_create(cap_channel_t *chan, int fdflags) fileargs_t * fileargs_init(int argc, char *argv[], int flags, mode_t mode, - cap_rights_t *rightsp) + cap_rights_t *rightsp, int operations) { nvlist_t *limits; @@ -181,7 +218,7 @@ fileargs_init(int argc, char *argv[], int flags, mode_ } limits = fileargs_create_limit(argc, (const char * const *)argv, flags, - mode, rightsp); + mode, rightsp, operations); if (limits == NULL) return (NULL); @@ -190,7 +227,7 @@ fileargs_init(int argc, char *argv[], int flags, mode_ fileargs_t * fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], int flags, - mode_t mode, cap_rights_t *rightsp) + mode_t mode, cap_rights_t *rightsp, int operations) { nvlist_t *limits; @@ -199,7 +236,7 @@ fileargs_cinit(cap_channel_t *cas, int argc, char *arg } limits = fileargs_create_limit(argc, (const char * const *)argv, flags, - mode, rightsp); + mode, rightsp, operations); if (limits == NULL) return (NULL); @@ -234,7 +271,7 @@ fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits) cap_channel_t *chann; fileargs_t *fa; int serrno, ret; - int flags; + int flags, operations; assert(cas != NULL); @@ -252,6 +289,7 @@ fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits) } flags = nvlist_get_number(limits, "flags"); + operations = nvlist_get_number(limits, "operations"); /* Limits are consumed no need to free them. */ ret = cap_limit_set(chann, limits); @@ -291,11 +329,11 @@ fileargs_open(fileargs_t *fa, const char *name) return (-1); } - fd = fileargs_get_cache(fa, name); + fd = fileargs_get_fd_cache(fa, name); if (fd != -1) return (fd); - nvl = fileargs_fetch(fa, name); + nvl = fileargs_fetch(fa, name, "open"); if (nvl == NULL) return (-1); @@ -322,6 +360,53 @@ fileargs_fopen(fileargs_t *fa, const char *name, const return (fdopen(fd, mode)); } +int +fileargs_lstat(fileargs_t *fa, const char *name, struct stat *sb) +{ + nvlist_t *nvl; + const void *buf; + size_t size; + char *cmd; + + assert(fa != NULL); + assert(fa->fa_magic == FILEARGS_MAGIC); + + if (name == NULL) { + errno = EINVAL; + return (-1); + } + + if (sb == NULL) { + errno = EFAULT; + return (-1); + } + + if (fa->fa_chann == NULL) { + errno = ENOTCAPABLE; + return (-1); + } + + if (fileargs_get_lstat_cache(fa, name, sb) != -1) + return (0); + + nvl = fileargs_fetch(fa, name, "lstat"); + if (nvl == NULL) + return (-1); + + buf = nvlist_get_binary(nvl, "stat", &size); + assert(size == sizeof(*sb)); + memcpy(sb, buf, size); + + cmd = nvlist_take_string(nvl, "cmd"); + if (strcmp(cmd, "cache") == 0) + fileargs_set_cache(fa, nvl); + else + nvlist_destroy(nvl); + free(cmd); + + return (0); +} + void fileargs_free(fileargs_t *fa) { @@ -348,6 +433,7 @@ static void *cacheposition; static bool allcached; static const cap_rights_t *caprightsp; static int capflags; +static int allowed_operations; static mode_t capmode; static int @@ -382,6 +468,7 @@ fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *l void *cookie; nvlist_t *new; const char *fname; + struct stat sb; if ((capflags & O_CREAT) != 0) { allcached = true; @@ -409,14 +496,25 @@ fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *l continue; } - fd = open_file(fname); - if (fd < 0) { - i--; - continue; + new = nvlist_create(NV_FLAG_NO_UNIQUE); + if ((allowed_operations & FA_OPEN) != 0) { + fd = open_file(fname); + if (fd < 0) { + i--; + nvlist_destroy(new); + continue; + } + nvlist_move_descriptor(new, "fd", fd); } + if ((allowed_operations & FA_LSTAT) != 0) { + if (lstat(fname, &sb) < 0) { + i--; + nvlist_destroy(new); + continue; + } + nvlist_add_binary(new, "stat", &sb, sizeof(sb)); + } - new = nvlist_create(NV_FLAG_NO_UNIQUE); - nvlist_move_descriptor(new, "fd", fd); nvlist_add_nvlist(nvlout, fname, new); } cacheposition = cookie; @@ -424,10 +522,13 @@ fileargs_add_cache(nvlist_t *nvlout, const nvlist_t *l } static bool -fileargs_allowed(const nvlist_t *limits, const nvlist_t *request) +fileargs_allowed(const nvlist_t *limits, const nvlist_t *request, int operation) { const char *name; + if ((allowed_operations & operation) == 0) + return (false); + name = dnvlist_get_string(request, "name", NULL); if (name == NULL) return (false); @@ -450,6 +551,7 @@ fileargs_limit(const nvlist_t *oldlimits, const nvlist return (ENOTCAPABLE); capflags = (int)dnvlist_get_number(newlimits, "flags", 0); + allowed_operations = (int)dnvlist_get_number(newlimits, "operations", 0); if ((capflags & O_CREAT) != 0) capmode = (mode_t)nvlist_get_number(newlimits, "mode"); else @@ -461,6 +563,37 @@ fileargs_limit(const nvlist_t *oldlimits, const nvlist } static int +fileargs_command_lstat(const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + int stat; + const char *name; + struct stat sb; + + if (limits == NULL) + return (ENOTCAPABLE); + + if (!fileargs_allowed(limits, nvlin, FA_LSTAT)) + return (ENOTCAPABLE); + + name = nvlist_get_string(nvlin, "name"); + + stat = lstat(name, &sb); + if (stat < 0) + return (errno); + + if (!allcached && (lastname == NULL || + strcmp(name, lastname) == 0)) { + nvlist_add_string(nvlout, "cmd", "cache"); + fileargs_add_cache(nvlout, limits, name); + } else { + nvlist_add_string(nvlout, "cmd", "lstat"); + } + nvlist_add_binary(nvlout, "stat", &sb, sizeof(sb)); + return (0); +} + +static int fileargs_command_open(const nvlist_t *limits, nvlist_t *nvlin, nvlist_t *nvlout) { @@ -470,7 +603,7 @@ fileargs_command_open(const nvlist_t *limits, nvlist_t if (limits == NULL) return (ENOTCAPABLE); - if (!fileargs_allowed(limits, nvlin)) + if (!fileargs_allowed(limits, nvlin, FA_OPEN)) return (ENOTCAPABLE); name = nvlist_get_string(nvlin, "name"); @@ -497,6 +630,9 @@ fileargs_command(const char *cmd, const nvlist_t *limi if (strcmp(cmd, "open") == 0) return (fileargs_command_open(limits, nvlin, nvlout)); + + if (strcmp(cmd, "lstat") == 0) + return (fileargs_command_lstat(limits, nvlin, nvlout)); return (EINVAL); } Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr 17 16:00:33 2019 (r346314) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr 17 16:02:57 2019 (r346315) @@ -36,16 +36,21 @@ #include +#define FA_OPEN 1 +#define FA_LSTAT 2 + #ifdef WITH_CASPER struct fileargs; typedef struct fileargs fileargs_t; +struct stat; fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode, - cap_rights_t *rightsp); + cap_rights_t *rightsp, int operations); fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], - int flags, mode_t mode, cap_rights_t *rightsp); + int flags, mode_t mode, cap_rights_t *rightsp, int operations); fileargs_t *fileargs_initnv(nvlist_t *limits); fileargs_t *fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits); +int fileargs_lstat(fileargs_t *fa, const char *name, struct stat *sb); int fileargs_open(fileargs_t *fa, const char *name); void fileargs_free(fileargs_t *fa); FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode); @@ -57,7 +62,7 @@ typedef struct fileargs { static inline fileargs_t * fileargs_init(int argc __unused, char *argv[] __unused, int flags, mode_t mode, - cap_rights_t *rightsp __unused) { + cap_rights_t *rightsp __unused, int operations __unused) { fileargs_t *fa; fa = malloc(sizeof(*fa)); @@ -71,10 +76,10 @@ fileargs_init(int argc __unused, char *argv[] __unused static inline fileargs_t * fileargs_cinit(cap_channel_t *cas __unused, int argc, char *argv[], int flags, - mode_t mode, cap_rights_t *rightsp) + mode_t mode, cap_rights_t *rightsp, int operations) { - return (fileargs_init(argc, argv, flags, mode, rightsp)); + return (fileargs_init(argc, argv, flags, mode, rightsp, operations)); } static inline fileargs_t * @@ -85,7 +90,8 @@ fileargs_initnv(nvlist_t *limits) fa = fileargs_init(0, NULL, nvlist_get_number(limits, "flags"), dnvlist_get_number(limits, "mode", 0), - NULL); + NULL, + nvlist_get_number(limits, "operations")); nvlist_destroy(limits); return (fa); @@ -98,6 +104,8 @@ fileargs_cinitnv(cap_channel_t *cas __unused, nvlist_t return (fileargs_initnv(limits)); } +#define fileargs_lstat(fa, name, sb) \ + lstat(name, sb) #define fileargs_open(fa, name) \ open(name, fa->fa_flags, fa->fa_mode) #define fileargs_fopen(fa, name, mode) \ From owner-svn-src-head@freebsd.org Wed Apr 17 16:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 033F41570B62; Wed, 17 Apr 2019 16:05:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A25686276; Wed, 17 Apr 2019 16:05:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 009571E6B0; Wed, 17 Apr 2019 16:05:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@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: <48b25255-3d66-69fc-658b-6176ebaf4640@FreeBSD.org> Date: Wed, 17 Apr 2019 09:05:52 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9A25686276 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.978,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: Wed, 17 Apr 2019 16:05:55 -0000 On 4/16/19 4:48 PM, Conrad Meyer wrote: > On Tue, Apr 16, 2019 at 4:31 PM John Baldwin wrote: >> bhyveload is effectively the loader in this case. It runs the normal loader >> scripts and logic and so would load the guests's /boot/entropy and pass it >> to the guest kernel as metadata just like the regular loader. > > Right, except it doesn't seem to do things like nuke /boot/nextboot.conf :-(. It just needs a disk write method I think for that to work, but I'm not sure that's currently in the userboot interface. >> In addition, bhyve also supports virtio-rng which is another way to provide >> entropy to guest OS's. That's why in my reply I focused on qemu for mips >> (or riscv) as for x86 hypervisors there are existing, somewhat-standarized >> solutions for the hypervisor to provide entropy to the guest. > > Perhaps cryptographically random stack-protector cookies are simply > inappropriate for MIPS or RISCV. Do we have any other examples of > kernel random consumers blocking after that immediate hiccup is > overcome? There may be MIPS and RISCV designs that do have suitable entropy available (especially I would expect future RISCV designs to have them), so I think blacklisting stack protector wholesale on those architectures is overboard. I think some sort of off-by-default knob (even a compile option) is fine for people who need fast and loose vs safe as you already agreed to earlier. Also, for development testing we still want coverage of using stack cookies on MIPS and RISCV even if the simulator environment gives not-very-strong cookie values. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 17 16:18:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C2B115710E9; Wed, 17 Apr 2019 16:18:16 +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 BDE2286900; Wed, 17 Apr 2019 16:18:15 +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 9872B98E8; Wed, 17 Apr 2019 16:18:15 +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 x3HGIF5w059580; Wed, 17 Apr 2019 16:18:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HGIERC059575; Wed, 17 Apr 2019 16:18:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171618.x3HGIERC059575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 16:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc X-SVN-Commit-Revision: 346316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDE2286900 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.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 17 Apr 2019 16:18:16 -0000 Author: emaste Date: Wed Apr 17 16:18:14 2019 New Revision: 346316 URL: https://svnweb.freebsd.org/changeset/base/346316 Log: cap_fileargs: chase r346315, update fileargs_init in consumers Reported by: ci.freebsd.org (8 times so far) MFC after: 3 weeks MFC with: r346315 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/strings/strings.c head/sbin/savecore/savecore.c head/usr.bin/brandelf/brandelf.c head/usr.bin/head/head.c head/usr.bin/wc/wc.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:02:57 2019 (r346315) +++ head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:18:14 2019 (r346316) @@ -195,7 +195,7 @@ main(int argc, char **argv) argv += optind; cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL); - fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights); + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); if (fa == NULL) err(1, "Unable to initialize casper fileargs"); Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Apr 17 16:02:57 2019 (r346315) +++ head/sbin/savecore/savecore.c Wed Apr 17 16:18:14 2019 (r346316) @@ -1030,7 +1030,7 @@ init_caps(int argc, char **argv) */ (void)cap_rights_init(&rights, CAP_PREAD, CAP_WRITE, CAP_IOCTL); capfa = fileargs_init(argc, argv, checkfor || keep ? O_RDONLY : O_RDWR, - 0, &rights); + 0, &rights, FA_OPEN); if (capfa == NULL) { logmsg(LOG_ERR, "fileargs_init(): %m"); exit(1); Modified: head/usr.bin/brandelf/brandelf.c ============================================================================== --- head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:02:57 2019 (r346315) +++ head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:18:14 2019 (r346316) @@ -133,7 +133,7 @@ main(int argc, char **argv) if (flags == O_RDWR) cap_rights_set(&rights, CAP_WRITE); - fa = fileargs_init(argc, argv, flags, 0, &rights); + fa = fileargs_init(argc, argv, flags, 0, &rights, FA_OPEN); if (fa == NULL) errx(1, "unable to init casper"); Modified: head/usr.bin/head/head.c ============================================================================== --- head/usr.bin/head/head.c Wed Apr 17 16:02:57 2019 (r346315) +++ head/usr.bin/head/head.c Wed Apr 17 16:18:14 2019 (r346316) @@ -115,7 +115,7 @@ main(int argc, char *argv[]) argv += optind; fa = fileargs_init(argc, argv, O_RDONLY, 0, - cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL)); + cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL), FA_OPEN); if (fa == NULL) errx(1, "unable to init casper"); Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Wed Apr 17 16:02:57 2019 (r346315) +++ head/usr.bin/wc/wc.c Wed Apr 17 16:18:14 2019 (r346316) @@ -133,7 +133,7 @@ main(int argc, char *argv[]) (void)signal(SIGINFO, siginfo_handler); fa = fileargs_init(argc, argv, O_RDONLY, 0, - cap_rights_init(&rights, CAP_READ, CAP_FSTAT)); + cap_rights_init(&rights, CAP_READ, CAP_FSTAT), FA_OPEN); if (fa == NULL) { xo_warn("Unable to init casper"); exit(1); From owner-svn-src-head@freebsd.org Wed Apr 17 16:27:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F2F615717F1; Wed, 17 Apr 2019 16:27:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B26FB87060; Wed, 17 Apr 2019 16:27:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F3EC9A98; Wed, 17 Apr 2019 16:27:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HGRhQd064939; Wed, 17 Apr 2019 16:27:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HGRhwk064938; Wed, 17 Apr 2019 16:27:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904171627.x3HGRhwk064938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 17 Apr 2019 16:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346317 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B26FB87060 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.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 17 Apr 2019 16:27:44 -0000 Author: ian Date: Wed Apr 17 16:27:43 2019 New Revision: 346317 URL: https://svnweb.freebsd.org/changeset/base/346317 Log: Allow this test script to be run from within src/tools/boot dir, and create the temporary image in $TMPDIR. Allow the script to be run from the src/tools/boot directory by using make -V SRCTOP to find the top of the tree, because this script is handy for quick smoke-testing of loader changes, as well as being useful in CI testing. Also, use a temp directory in $TMPDIR to assemble the boot image, and write the boot log file to $TMPDIR. Arrange to have the temporary image clean itself up, but leave the log file in $TMPDIR for post-mortem analysis of failures when the script is run interactively. Differential Revision: https://reviews.freebsd.org/D19876 Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Wed Apr 17 16:18:14 2019 (r346316) +++ head/tools/boot/ci-qemu-test.sh Wed Apr 17 16:27:43 2019 (r346317) @@ -2,62 +2,105 @@ # Install loader, kernel, and enough of userland to boot in QEMU and echo # "Hello world." from init, as a very quick smoke test for CI. Uses QEMU's -# virtual FAT filesystem to avoid the need to create a disk image. +# virtual FAT filesystem to avoid the need to create a disk image. While +# designed for CI automated testing, this script can also be run by hand as +# a quick smoke-test. The rootgen.sh and related scripts generate much more +# extensive tests for many combinations of boot env (ufs, zfs, geli, etc). # # $FreeBSD$ set -e -# Root directory for minimal FreeBSD installation. -ROOTDIR=$(pwd)/fat-root +die() +{ + echo "$*" 1>&2 + exit 1 +} -# Create minimal directory structure. -rm -f $ROOTDIR/efi/boot/BOOTx64.EFI -for dir in dev bin efi/boot etc lib libexec sbin usr/libexec; do - mkdir -p $ROOTDIR/$dir -done +tempdir_cleanup() +{ + trap - EXIT SIGINT SIGHUP SIGTERM SIGQUIT + rm -rf ${ROOTDIR} +} -# Install kernel, loader and minimal userland. -make -DNO_ROOT DESTDIR=$ROOTDIR \ - MODULES_OVERRIDE= \ - WITHOUT_DEBUG_FILES=yes \ - WITHOUT_KERNEL_SYMBOLS=yes \ - installkernel -for dir in stand \ - lib/libc lib/libedit lib/ncurses \ - libexec/rtld-elf \ - bin/sh sbin/init sbin/shutdown; do - make -DNO_ROOT DESTDIR=$ROOTDIR INSTALL="install -U" \ - WITHOUT_MAN= \ - WITHOUT_PROFILE= \ - WITHOUT_TESTS= \ - WITHOUT_TOOLCHAIN= \ - -C $dir install -done +tempdir_setup() +{ + # Create minimal directory structure and populate it. + # Caller must cd ${SRCTOP} before calling this function. -# Put loader in standard EFI location. -mv $ROOTDIR/boot/loader.efi $ROOTDIR/efi/boot/BOOTx64.EFI + for dir in dev bin efi/boot etc lib libexec sbin usr/lib usr/libexec; do + mkdir -p ${ROOTDIR}/${dir} + done -# Configuration files. -cat > $ROOTDIR/boot/loader.conf < ${ROOTDIR}/boot/loader.conf < $ROOTDIR/etc/rc < ${ROOTDIR}/etc/rc <&1 | tee boot.log -grep -q 'Hello world.' boot.log -echo OK + qemu-system-x86_64 -m 256M -bios ${OVMF} \ + -serial stdio -vga none -nographic -monitor none \ + -snapshot -hda fat:${ROOTDIR} 2>&1 | tee ${BOOTLOG} + +# Check whether we succesfully booted... +if grep -q 'Hello world.' ${BOOTLOG}; then + echo "OK" +else + die "Did not boot successfully, see ${BOOTLOG}" +fi From owner-svn-src-head@freebsd.org Wed Apr 17 16:31:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B48B1571AAF; Wed, 17 Apr 2019 16:31:31 +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 E14FB872BF; Wed, 17 Apr 2019 16:31:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC5E19AE7; Wed, 17 Apr 2019 16:31:30 +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 x3HGVUek066701; Wed, 17 Apr 2019 16:31:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HGVUX1066700; Wed, 17 Apr 2019 16:31:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171631.x3HGVUX1066700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 16:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346318 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 346318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E14FB872BF 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 16:31:31 -0000 Author: emaste Date: Wed Apr 17 16:31:30 2019 New Revision: 346318 URL: https://svnweb.freebsd.org/changeset/base/346318 Log: cap_fileargs: fix GCC build, don't shadow 'stat' Reported by: ci.freebsd.org MFC after: 3 weeks MFC with: r346315 Sponsored by: The FreeBSD Foundation Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 16:27:43 2019 (r346317) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 16:31:30 2019 (r346318) @@ -566,7 +566,7 @@ static int fileargs_command_lstat(const nvlist_t *limits, nvlist_t *nvlin, nvlist_t *nvlout) { - int stat; + int error; const char *name; struct stat sb; @@ -578,7 +578,7 @@ fileargs_command_lstat(const nvlist_t *limits, nvlist_ name = nvlist_get_string(nvlin, "name"); - stat = lstat(name, &sb); + error = lstat(name, &sb); if (stat < 0) return (errno); From owner-svn-src-head@freebsd.org Wed Apr 17 16:42:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78E901571D2D; Wed, 17 Apr 2019 16:42:55 +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 1A3F987A9B; Wed, 17 Apr 2019 16:42:55 +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 EBC949E11; Wed, 17 Apr 2019 16:42:54 +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 x3HGgsof075254; Wed, 17 Apr 2019 16:42:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HGgslA075253; Wed, 17 Apr 2019 16:42:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201904171642.x3HGgslA075253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Apr 2019 16:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346319 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 346319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A3F987A9B 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 16:42:55 -0000 Author: kp Date: Wed Apr 17 16:42:54 2019 New Revision: 346319 URL: https://svnweb.freebsd.org/changeset/base/346319 Log: pf: Fix panic on invalid DIOCRSETTFLAGS If during DIOCRSETTFLAGS pfrio_buffer is NULL copyin() will fault, which we're not allowed to do with a lock held. We must count the number of entries in the table and release the lock during copyin(). Only then can we re-acquire the lock. Note that this is safe, because pfr_set_tflags() will check if the table and entries exist. This was discovered by a local syzcaller instance. MFC after: 1 week Event: Aberdeen hackathon 2019 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Wed Apr 17 16:31:30 2019 (r346318) +++ head/sys/netpfil/pf/pf_ioctl.c Wed Apr 17 16:42:54 2019 (r346319) @@ -3103,24 +3103,24 @@ DIOCCHANGEADDR_error: break; } - PF_RULES_WLOCK(); + PF_RULES_RLOCK(); n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); io->pfrio_size = min(io->pfrio_size, n); + PF_RULES_RUNLOCK(); totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), M_TEMP, M_NOWAIT); if (pfrts == NULL) { error = ENOMEM; - PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); - PF_RULES_WUNLOCK(); break; } + PF_RULES_WLOCK(); error = pfr_set_tflags(pfrts, io->pfrio_size, io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); From owner-svn-src-head@freebsd.org Wed Apr 17 16:43:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B6441571D72; Wed, 17 Apr 2019 16:43:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E20F87BFF; Wed, 17 Apr 2019 16:43:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 089AE12FCE; Wed, 17 Apr 2019 16:43:32 +0000 (UTC) Date: Wed, 17 Apr 2019 16:43:32 +0000 From: Alexey Dokuchaev To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346318 - head/lib/libcasper/services/cap_fileargs Message-ID: <20190417164331.GA14717@FreeBSD.org> References: <201904171631.x3HGVUX1066700@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904171631.x3HGVUX1066700@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 2E20F87BFF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,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: Wed, 17 Apr 2019 16:43:32 -0000 On Wed, Apr 17, 2019 at 04:31:30PM +0000, Ed Maste wrote: > New Revision: 346318 > URL: https://svnweb.freebsd.org/changeset/base/346318 > > Log: > cap_fileargs: fix GCC build, don't shadow 'stat' > > @@ -566,7 +566,7 @@ static int > fileargs_command_lstat(const nvlist_t *limits, nvlist_t *nvlin, > nvlist_t *nvlout) > { > - int stat; > + int error; > const char *name; > struct stat sb; > > @@ -578,7 +578,7 @@ fileargs_command_lstat(const nvlist_t *limits, nvlist_ > > name = nvlist_get_string(nvlin, "name"); > > - stat = lstat(name, &sb); > + error = lstat(name, &sb); > if (stat < 0) > return (errno); Looks like "if (stat < 0)" is wrong now. ./danfe From owner-svn-src-head@freebsd.org Wed Apr 17 16:45:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13AC01571EB2; Wed, 17 Apr 2019 16:45:37 +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 AE2C387E2B; Wed, 17 Apr 2019 16:45:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 842E99E12; Wed, 17 Apr 2019 16:45:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HGja7k075445; Wed, 17 Apr 2019 16:45:36 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HGjaYt075444; Wed, 17 Apr 2019 16:45:36 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201904171645.x3HGjaYt075444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Apr 2019 16:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346320 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 346320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE2C387E2B 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.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 17 Apr 2019 16:45:37 -0000 Author: kp Date: Wed Apr 17 16:45:35 2019 New Revision: 346320 URL: https://svnweb.freebsd.org/changeset/base/346320 Log: pf tests: Try to provoke the panic with invalid DIOCRSETTFLAGS There was an issue with copyin() on DIOCRSETTFLAGS, which would panic if pfrio_buffer was NULL. Test for the issue fixed in r346319. MFC after: 1 week Event: Aberdeen hackathon 2019 Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Wed Apr 17 16:42:54 2019 (r346319) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Wed Apr 17 16:45:35 2019 (r346320) @@ -305,6 +305,11 @@ ATF_TC_BODY(settflags, tc) io.pfrio_size = 1 << 28; if (ioctl(dev, DIOCRSETTFLAGS, &io) != 0) atf_tc_fail("Request with size 1 << 24 failed"); + + /* NULL buffer */ + io.pfrio_buffer = NULL; + if (ioctl(dev, DIOCRSETTFLAGS, &io) != -1) + atf_tc_fail("Request with NULL buffer succeeded"); } ATF_TC_CLEANUP(settflags, tc) From owner-svn-src-head@freebsd.org Wed Apr 17 16:45:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F2691571EEF; Wed, 17 Apr 2019 16:45:46 +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 0F2C987EED; Wed, 17 Apr 2019 16:45:46 +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 4FC099E13; Wed, 17 Apr 2019 16:45:43 +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 x3HGjh06075495; Wed, 17 Apr 2019 16:45:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HGjhV1075494; Wed, 17 Apr 2019 16:45:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171645.x3HGjhV1075494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 16:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346321 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 346321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F2C987EED 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 16:45:46 -0000 Author: emaste Date: Wed Apr 17 16:45:42 2019 New Revision: 346321 URL: https://svnweb.freebsd.org/changeset/base/346321 Log: cap_fileargs: fix test after r346318 Reported by: danfe, mjg MFC after: 3 weeks MFC with: r346315 Sponsored by: The FreeBSD Foundation Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 16:45:35 2019 (r346320) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Apr 17 16:45:42 2019 (r346321) @@ -579,7 +579,7 @@ fileargs_command_lstat(const nvlist_t *limits, nvlist_ name = nvlist_get_string(nvlin, "name"); error = lstat(name, &sb); - if (stat < 0) + if (error < 0) return (errno); if (!allcached && (lastname == NULL || From owner-svn-src-head@freebsd.org Wed Apr 17 16:53:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA8C31572211; Wed, 17 Apr 2019 16:53:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8550F88425; Wed, 17 Apr 2019 16:53:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm1-x32c.google.com with SMTP id z6so5064948wmi.0; Wed, 17 Apr 2019 09:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4zVKHO9SQEXTLl1Gc+wirfNUm1cXSr2aEZzspW/TLkg=; b=pC3By7K4TeKLHH+gvbYNBdL4Z7iXoY45TU0wR/jbMaSbLBiemIPLUUiQi/S2QFUyhd mLVD8pjneHoPmYlffEDp1cmq2FLEBIS10f4vgvBOXF8TkXAfQeSY+Z1F3BpvVUQToHB5 KcOB1etUfNAsA+cPgASHouFzbNH63a8MgM4Nfj0/QHT8FP1Fx3yx0Q8pzTiQnO0EyNgj 37njgLfKkPvb+pJtqEZOD9eekaQiKP4Z2CCwx7fi/Sz3CLiaoIheVys2/v+hplMYEukP ZOPDLjeWymEnj8I2GRQUXOpkz+IECRxjLidiKDu+46MAIHUjBvWSbBVhxwaOCJ8qogsw +ZCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4zVKHO9SQEXTLl1Gc+wirfNUm1cXSr2aEZzspW/TLkg=; b=k2kxitOP3kmSOGAyXB036zYl5uDcnldLreY0G3McUrbWlxeCth4lO5asSI0esd1c12 1jTust4ObUD7EijU7LnwNETGg9TEiJmVkCWL+D4sYSOgwl49HdPV15OMAvdiVePwlP+2 0uD8HbssKlEaYI3xQUNQJsJ0qlcqykjIXgZN/mYCzN7gOlnkryDx+Q19Ivc7gScABErV jHw5zYxj+8p1R3afvUtLDQTd472gkmaFYhmj3xFWgT1o7+QmDjHQmwzPVk0aAxjjTXLA XJK/65E8W0EtEps+KK9N2ETyH6utEoUvRFzoE95rK3darzZXQQI6EsFQMSOSORdHv8A/ ndgg== X-Gm-Message-State: APjAAAVRqkaDyc0k5wz7alyl/sxeYOVa+UbBhZT8Eb2m9DFXWlbifrLV 2AqmxuM1narBPA/9sEeKwZfphoXgvqxYE9xdEVxOIA== X-Google-Smtp-Source: APXvYqwByrE577Wx9CNgVo8eWzcclfDWRaqxb/l17/8bHW9Y/85LlSUE8URHMrTQyN+vJYH+1Fi9yKuX2anlt8Qw/8s= X-Received: by 2002:a1c:1f08:: with SMTP id f8mr468636wmf.97.1555520003529; Wed, 17 Apr 2019 09:53:23 -0700 (PDT) MIME-Version: 1.0 References: <201904041632.x34GWR4Z006164@repo.freebsd.org> <20190415024246.GA36864@x-wing> In-Reply-To: <20190415024246.GA36864@x-wing> From: Adrian Chadd Date: Wed, 17 Apr 2019 09:53:11 -0700 Message-ID: Subject: Re: svn commit: r345875 - in head: contrib/elftoolchain/strings usr.bin/strings To: Mariusz Zaborski Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 8550F88425 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=pC3By7K4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2a00:1450:4864:20::32c as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-6.60 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.78)[-0.780,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.81)[ip: (-9.36), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-2.22), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[c.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2] 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: Wed, 17 Apr 2019 16:53:27 -0000 not yet? I'm still debugging other issues; this just pissed off gcc. :) -a On Sun, 14 Apr 2019 at 19:42, Mariusz Zaborski wrote: > On Sun, Apr 14, 2019 at 08:19:22AM -0700, Adrian Chadd wrote: > > This exposed a fun bug - gcc mips 6.4.0 complains about an unused arg > (fa) > > in fileargs_fopen() in the strings change when you compile without casper > > support. I do that on mips. > > > > I have a local change that converts the #define to an inline function so > > the unused arg can be (void)'ed away. Mind if I commit it? > Sounds good to me. > Although you don't have an issue with others services? > > -- > Mariusz Zaborski > oshogbo//vx | http://oshogbo.vexillium.org > FreeBSD committer | https://freebsd.org > Software developer | http://wheelsystems.com > If it's not broken, let's fix it till it is!!1 > > > > > On Thu, 4 Apr 2019 at 09:32, Mariusz Zaborski > wrote: > > > > > Author: oshogbo > > > Date: Thu Apr 4 16:32:27 2019 > > > New Revision: 345875 > > > URL: https://svnweb.freebsd.org/changeset/base/345875 > > > > > > Log: > > > strings: capsicumize it > > > > > > Reviewed by: cem > > > Discussed with: emaste > > > Differential Revision: https://reviews.freebsd.org/D18038 > > > > > > Modified: > > > head/contrib/elftoolchain/strings/strings.c > > > head/usr.bin/strings/Makefile > > > > > > Modified: head/contrib/elftoolchain/strings/strings.c > > > > > > > ============================================================================== > > > --- head/contrib/elftoolchain/strings/strings.c Thu Apr 4 12:02:48 > 2019 > > > (r345874) > > > +++ head/contrib/elftoolchain/strings/strings.c Thu Apr 4 16:32:27 > 2019 > > > (r345875) > > > @@ -25,8 +25,10 @@ > > > */ > > > > > > #include > > > +#include > > > #include > > > > > > +#include > > > #include > > > #include > > > #include > > > @@ -44,6 +46,9 @@ > > > #include > > > #include > > > > > > +#include > > > +#include > > > + > > > #include "_elftc.h" > > > > > > ELFTC_VCSID("$Id: strings.c 3648 2018-11-22 23:26:43Z emaste $"); > > > @@ -85,7 +90,7 @@ static struct option strings_longopts[] = { > > > }; > > > > > > int getcharacter(FILE *, long *); > > > -int handle_file(const char *); > > > +int handle_file(fileargs_t *fa, const char *); > > > int handle_elf(const char *, FILE *); > > > int handle_binary(const char *, FILE *, size_t); > > > int find_strings(const char *, FILE *, off_t, off_t); > > > @@ -99,6 +104,8 @@ void usage(void); > > > int > > > main(int argc, char **argv) > > > { > > > + fileargs_t *fa; > > > + cap_rights_t rights; > > > int ch, rc; > > > > > > rc = 0; > > > @@ -187,27 +194,41 @@ main(int argc, char **argv) > > > argc -= optind; > > > argv += optind; > > > > > > + cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, > CAP_FCNTL); > > > + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights); > > > + if (fa == NULL) > > > + err(1, "Unable to initialize casper fileargs"); > > > + > > > + caph_cache_catpages(); > > > + if (caph_limit_stdio() < 0 && caph_enter_casper() < 0) { > > > + fileargs_free(fa); > > > + err(1, "Unable to enter capability mode"); > > > + } > > > + > > > if (min_len == 0) > > > min_len = 4; > > > if (*argv == NULL) > > > rc = find_strings("{standard input}", stdin, 0, 0); > > > else while (*argv != NULL) { > > > - if (handle_file(*argv) != 0) > > > + if (handle_file(fa, *argv) != 0) > > > rc = 1; > > > argv++; > > > } > > > + > > > + fileargs_free(fa); > > > + > > > return (rc); > > > } > > > > > > int > > > -handle_file(const char *name) > > > +handle_file(fileargs_t *fa, const char *name) > > > { > > > FILE *pfile; > > > int rt; > > > > > > if (name == NULL) > > > return (1); > > > - pfile = fopen(name, "rb"); > > > + pfile = fileargs_fopen(fa, name, "rb"); > > > if (pfile == NULL) { > > > warnx("'%s': %s", name, strerror(errno)); > > > return (1); > > > > > > Modified: head/usr.bin/strings/Makefile > > > > > > > ============================================================================== > > > --- head/usr.bin/strings/Makefile Thu Apr 4 12:02:48 2019 > > > (r345874) > > > +++ head/usr.bin/strings/Makefile Thu Apr 4 16:32:27 2019 > > > (r345875) > > > @@ -10,6 +10,12 @@ PROG= strings > > > > > > LIBADD= elftc elf > > > > > > +.if ${MK_CASPER} != "no" && !defined(BOOTSTRAPPING) > > > +LIBADD+= casper > > > +LIBADD+= cap_fileargs > > > +CFLAGS+= -DWITH_CASPER > > > +.endif > > > + > > > CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common > > > > > > .include > > > > > > > From owner-svn-src-head@freebsd.org Wed Apr 17 16:58:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A7A81572390; Wed, 17 Apr 2019 16:58:39 +0000 (UTC) (envelope-from adrian@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 1C7278867A; Wed, 17 Apr 2019 16:58:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBE3F9FD1; Wed, 17 Apr 2019 16:58:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HGwcrw080599; Wed, 17 Apr 2019 16:58:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HGwckd080598; Wed, 17 Apr 2019 16:58:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201904171658.x3HGwckd080598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 17 Apr 2019 16:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346322 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 346322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C7278867A 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 16:58:39 -0000 Author: adrian Date: Wed Apr 17 16:58:38 2019 New Revision: 346322 URL: https://svnweb.freebsd.org/changeset/base/346322 Log: [casper] fix compilation when casper is disabled. This triggers an error in gcc-mips 6.4.0 complaining about unused arguments. Tested: * compiled/run on mips32; nothing complained. Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr 17 16:45:42 2019 (r346321) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h Wed Apr 17 16:58:38 2019 (r346322) @@ -108,8 +108,12 @@ fileargs_cinitnv(cap_channel_t *cas __unused, nvlist_t lstat(name, sb) #define fileargs_open(fa, name) \ open(name, fa->fa_flags, fa->fa_mode) -#define fileargs_fopen(fa, name, mode) \ - fopen(name, mode) +static inline +FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode) +{ + (void) fa; + return (fopen(name, mode)); +} #define fileargs_free(fa) (free(fa)) #endif From owner-svn-src-head@freebsd.org Wed Apr 17 17:00:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38AB01572465; Wed, 17 Apr 2019 17:00:17 +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 A06BC88845; Wed, 17 Apr 2019 17:00:16 +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 7DCA09FD8; Wed, 17 Apr 2019 17:00:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HH0GSa080770; Wed, 17 Apr 2019 17:00:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HH0Gfg080769; Wed, 17 Apr 2019 17:00:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171700.x3HH0Gfg080769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 17:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346323 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 346323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A06BC88845 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_SHORT(-0.98)[-0.977,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)[-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: Wed, 17 Apr 2019 17:00:17 -0000 Author: emaste Date: Wed Apr 17 17:00:16 2019 New Revision: 346323 URL: https://svnweb.freebsd.org/changeset/base/346323 Log: readelf: speed up readelf -wo Use an array instead of STAILQ, and sort at the end instead of while adding new elements. PR: 212539 Submitted by: Bora Özarslan Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Apr 17 16:58:38 2019 (r346322) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Apr 17 17:00:16 2019 (r346323) @@ -225,6 +225,15 @@ struct flag_desc { const char *desc; }; +struct loc_at { + Dwarf_Attribute la_at; + Dwarf_Unsigned la_off; + Dwarf_Unsigned la_lowpc; + Dwarf_Half la_cu_psize; + Dwarf_Half la_cu_osize; + Dwarf_Half la_cu_ver; +}; + static void add_dumpop(struct readelf *re, size_t si, const char *sn, int op, int t); static const char *aeabi_adv_simd_arch(uint64_t simd); @@ -341,6 +350,7 @@ static const char *get_string(struct readelf *re, int static const char *get_symbol_name(struct readelf *re, int symtab, int i); static uint64_t get_symbol_value(struct readelf *re, int symtab, int i); static void load_sections(struct readelf *re); +static int loc_at_comparator(const void *la1, const void *la2); static const char *mips_abi_fp(uint64_t fp); static const char *note_type(const char *note_name, unsigned int et, unsigned int nt); @@ -359,7 +369,8 @@ static const char *ppc_abi_vector(uint64_t vec); static void readelf_usage(int status); static void readelf_version(void); static void search_loclist_at(struct readelf *re, Dwarf_Die die, - Dwarf_Unsigned lowpc); + Dwarf_Unsigned lowpc, struct loc_at **la_list, + unsigned int *la_list_len, unsigned int *la_list_cap); static void search_ver(struct readelf *re); static const char *section_type(unsigned int mach, unsigned int stype); static void set_cu_context(struct readelf *re, Dwarf_Half psize, @@ -6034,21 +6045,28 @@ dump_dwarf_str(struct readelf *re) } } -struct loc_at { - Dwarf_Attribute la_at; - Dwarf_Unsigned la_off; - Dwarf_Unsigned la_lowpc; - Dwarf_Half la_cu_psize; - Dwarf_Half la_cu_osize; - Dwarf_Half la_cu_ver; - TAILQ_ENTRY(loc_at) la_next; -}; +static int +loc_at_comparator(const void *la1, const void *la2) +{ + const struct loc_at *left, *right; -static TAILQ_HEAD(, loc_at) lalist = TAILQ_HEAD_INITIALIZER(lalist); + left = (const struct loc_at *)la1; + right = (const struct loc_at *)la2; + if (left->la_off > right->la_off) + return (1); + else if (left->la_off < right->la_off) + return (-1); + else + return (0); +} + static void -search_loclist_at(struct readelf *re, Dwarf_Die die, Dwarf_Unsigned lowpc) +search_loclist_at(struct readelf *re, Dwarf_Die die, Dwarf_Unsigned lowpc, + struct loc_at **la_list, unsigned int *la_list_len, + unsigned int *la_list_cap) { + struct loc_at *la; Dwarf_Attribute *attr_list; Dwarf_Die ret_die; Dwarf_Unsigned off; @@ -6057,7 +6075,6 @@ search_loclist_at(struct readelf *re, Dwarf_Die die, D Dwarf_Half attr, form; Dwarf_Bool is_info; Dwarf_Error de; - struct loc_at *la, *nla; int i, ret; is_info = dwarf_get_die_infotypes_flag(die); @@ -6105,33 +6122,21 @@ search_loclist_at(struct readelf *re, Dwarf_Die die, D } else continue; - TAILQ_FOREACH(la, &lalist, la_next) { - if (off == la->la_off) - break; - if (off < la->la_off) { - if ((nla = malloc(sizeof(*nla))) == NULL) - err(EXIT_FAILURE, "malloc failed"); - nla->la_at = attr_list[i]; - nla->la_off = off; - nla->la_lowpc = lowpc; - nla->la_cu_psize = re->cu_psize; - nla->la_cu_osize = re->cu_osize; - nla->la_cu_ver = re->cu_ver; - TAILQ_INSERT_BEFORE(la, nla, la_next); - break; - } + if (*la_list_cap == *la_list_len) { + *la_list = realloc(*la_list, + *la_list_cap * 2 * sizeof(**la_list)); + if (la_list == NULL) + errx(EXIT_FAILURE, "realloc failed"); + *la_list_cap *= 2; } - if (la == NULL) { - if ((nla = malloc(sizeof(*nla))) == NULL) - err(EXIT_FAILURE, "malloc failed"); - nla->la_at = attr_list[i]; - nla->la_off = off; - nla->la_lowpc = lowpc; - nla->la_cu_psize = re->cu_psize; - nla->la_cu_osize = re->cu_osize; - nla->la_cu_ver = re->cu_ver; - TAILQ_INSERT_TAIL(&lalist, nla, la_next); - } + la = &((*la_list)[*la_list_len]); + la->la_at = attr_list[i]; + la->la_off = off; + la->la_lowpc = lowpc; + la->la_cu_psize = re->cu_psize; + la->la_cu_osize = re->cu_osize; + la->la_cu_ver = re->cu_ver; + (*la_list_len)++; } cont_search: @@ -6140,14 +6145,16 @@ cont_search: if (ret == DW_DLV_ERROR) warnx("dwarf_child: %s", dwarf_errmsg(de)); else if (ret == DW_DLV_OK) - search_loclist_at(re, ret_die, lowpc); + search_loclist_at(re, ret_die, lowpc, la_list, + la_list_len, la_list_cap); /* Search sibling. */ ret = dwarf_siblingof_b(re->dbg, die, &ret_die, is_info, &de); if (ret == DW_DLV_ERROR) warnx("dwarf_siblingof: %s", dwarf_errmsg(de)); else if (ret == DW_DLV_OK) - search_loclist_at(re, ret_die, lowpc); + search_loclist_at(re, ret_die, lowpc, la_list, + la_list_len, la_list_cap); } static void @@ -6430,9 +6437,14 @@ dump_dwarf_loclist(struct readelf *re) Dwarf_Signed lcnt; Dwarf_Half tag, version, pointer_size, off_size; Dwarf_Error de; - struct loc_at *la; + struct loc_at *la_list, *left, *right, *la; + unsigned int la_list_len, la_list_cap, duplicates, k; int i, j, ret, has_content; + la_list_len = 0; + la_list_cap = 200; + if ((la_list = calloc(la_list_cap, sizeof(struct loc_at))) == NULL) + errx(EXIT_FAILURE, "calloc failed"); /* Search .debug_info section. */ while ((ret = dwarf_next_cu_header_b(re->dbg, NULL, &version, NULL, &pointer_size, &off_size, NULL, NULL, &de)) == DW_DLV_OK) { @@ -6453,7 +6465,8 @@ dump_dwarf_loclist(struct readelf *re) } /* Search attributes for reference to .debug_loc section. */ - search_loclist_at(re, die, lowpc); + search_loclist_at(re, die, lowpc, &la_list, + &la_list_len, &la_list_cap); } if (ret == DW_DLV_ERROR) warnx("dwarf_next_cu_header: %s", dwarf_errmsg(de)); @@ -6485,17 +6498,37 @@ dump_dwarf_loclist(struct readelf *re) * Search attributes for reference to .debug_loc * section. */ - search_loclist_at(re, die, lowpc); + search_loclist_at(re, die, lowpc, &la_list, + &la_list_len, &la_list_cap); } if (ret == DW_DLV_ERROR) warnx("dwarf_next_cu_header: %s", dwarf_errmsg(de)); } while (dwarf_next_types_section(re->dbg, &de) == DW_DLV_OK); - if (TAILQ_EMPTY(&lalist)) + if (la_list_len == 0) { + free(la_list); return; + } + /* Sort la_list using loc_at_comparator. */ + qsort(la_list, la_list_len, sizeof(struct loc_at), loc_at_comparator); + + /* Get rid of the duplicates in la_list. */ + duplicates = 0; + for (k = 1; k < la_list_len; ++k) { + left = &la_list[k - 1 - duplicates]; + right = &la_list[k]; + + if (left->la_off == right->la_off) + duplicates++; + else + la_list[k - duplicates] = *right; + } + la_list_len -= duplicates; + has_content = 0; - TAILQ_FOREACH(la, &lalist, la_next) { + for (k = 0; k < la_list_len; ++k) { + la = &la_list[k]; if ((ret = dwarf_loclist_n(la->la_at, &llbuf, &lcnt, &de)) != DW_DLV_OK) { if (ret != DW_DLV_NO_ENTRY) @@ -6545,6 +6578,8 @@ dump_dwarf_loclist(struct readelf *re) if (!has_content) printf("\nSection '.debug_loc' has no debugging data.\n"); + + free(la_list); } /* @@ -6892,7 +6927,6 @@ dump_elf(struct readelf *re) static void dump_dwarf(struct readelf *re) { - struct loc_at *la, *_la; Dwarf_Error de; int error; @@ -6929,11 +6963,6 @@ dump_dwarf(struct readelf *re) dump_dwarf_str(re); if (re->dop & DW_O) dump_dwarf_loclist(re); - - TAILQ_FOREACH_SAFE(la, &lalist, la_next, _la) { - TAILQ_REMOVE(&lalist, la, la_next); - free(la); - } dwarf_finish(re->dbg, &de); } From owner-svn-src-head@freebsd.org Wed Apr 17 17:08:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F105315729D5 for ; Wed, 17 Apr 2019 17:08:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 900BD89009 for ; Wed, 17 Apr 2019 17:08:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x842.google.com with SMTP id w5so28141951qtb.11 for ; Wed, 17 Apr 2019 10:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z4gCfGlS9QARz41t/La0ab7tehoJuA69FZHemKOFdGc=; b=hrzMQr6cbzQ8lFAjd9t0Ku9BG4SZuO2D7JW2A6ANBrrREeJ2o8xd8dTph5Brx3AcnH gkZZqb6uXvLly92zzFM4uKZGHPgUwWpD68NVBvpS+0lb/eB9kaCneLjTT5cg36tGBmma iYFMq5+71aUiShoKn3R1dQs4dTZDSaA8+l+kExXWEoXxyvl0k6p2gmFaF60qsHf6rSJy 3dqTw1niIhi6bDSBSi/zD/SXGVSsYUhaW6x1xXQgl/Xvu2yBvPWMHm1hr1yMOGdrw9ni m8o1237AMZVY85ccaaILLu0tqaXNUK6orl4fw92K80okzntM0AxApab8GZ9DRLQaUkq0 sa5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z4gCfGlS9QARz41t/La0ab7tehoJuA69FZHemKOFdGc=; b=nG/Fyn0vrK9yf+jPKJMhfdhaNf+DH/erzxUlfu1Y00wmN/lRvWZ4Zv0/kbG8UBNBSK ddw35lPrKgHtaCmHRwaCPo4COkyZMATNt5RZ6K1yRcRV3DD6Q/c7Pm31P4TUavqZHxHH a0u6AhJUsohO5G6X0dIPw9xyYfY2hp2CIAnBJX6kG55CurifTUAnt7wbPMD+21dTFNww /x7SgxZZFayQgmHVSy9zOG17RsV4wJQ0kJ+o/1KMImJsuS5jenej+KDmbVxC6KIVTWfk pOJ7J2YebnZ7iYe5Zy6SfHqBwsBjO55Vu8TxHKd6F6tXDYS9tp2GeE0ZbhvOebnCaJD4 UsFA== X-Gm-Message-State: APjAAAWv101sIqmoYebznHkZ8iVfNN2JMfpasH9NU8Xt/1xtgTe4mh3S 6JMtPRSjtOacHNophZZD+5srFZFWR00OOTm/4muMtg== X-Google-Smtp-Source: APXvYqzuDK4jeVWGx82V/3dwSHv5C8VKVsDboGNIyN9AAUB3Jufibgstu+rIuEZoXgJW46ZYoFrL3QgdiIlSCEpeeec= X-Received: by 2002:ac8:4685:: with SMTP id g5mr72658930qto.242.1555520916889; Wed, 17 Apr 2019 10:08:36 -0700 (PDT) MIME-Version: 1.0 References: <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> In-Reply-To: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> From: Warner Losh Date: Wed, 17 Apr 2019 11:08:24 -0600 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: "Rodney W. Grimes" Cc: John Baldwin , "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 900BD89009 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.982,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Wed, 17 Apr 2019 17:08:38 -0000 On Tue, Apr 16, 2019, 4:51 PM Rodney W. Grimes wrote: > > On 4/15/19 11:40 AM, Conrad Meyer wrote: > > > Author: cem > > > Date: Mon Apr 15 18:40:36 2019 > > > New Revision: 346250 > > > URL: https://svnweb.freebsd.org/changeset/base/346250 > > > > > > Log: > > > random(4): Block read_random(9) on initial seeding > > > > > > read_random() is/was used, mostly without error checking, in a lot of > > > very sensitive places in the kernel -- including seeding the widely > used > > > arc4random(9). > > > > > > Most uses, especially arc4random(9), should block until the device > is seeded > > > rather than proceeding with a bogus or empty seed. I did not spy any > > > obvious kernel consumers where blocking would be inappropriate (in > the > > > sense that lack of entropy would be ok -- I did not investigate > locking > > > angle thoroughly). In many instances, arc4random_buf(9) or that > family > > > of APIs would be more appropriate anyway; that work was done in > r345865. > > > > There are definitely places arc4random is used where sleeping is not > allowed. > > ipsec generating nonces for AES-CBC is one example I can think of off the > > top of my head. I think it might be useful to add an explicit > WITNESS_WARN > > in arc4random to catch these cases so they can be found and reasoned > about. > > > > > This change primarily impacts the behavior of /dev/random on embedded > > > systems with read-only media that do not configure "nodevice > random". We > > > toggle the default from 'charge on blindly with no entropy' to 'block > > > indefinitely.' This default is safer, but may cause frustration. > Embedded > > > system designers using FreeBSD have several options. The most > obvious is to > > > plan to have a small writable NVRAM or NAND to persist entropy, like > larger > > > systems. Early entropy can be fed from any loader, or by writing > directly > > > to /dev/random during boot. Some embedded SoCs now provide a fast > hardware > > > entropy source; this would also work for quickly seeding Fortuna. A > 3rd > > > option would be creating an embedded-specific, more simplistic random > > > module, like that designed by DJB in [1] (this design still requires > a small > > > rewritable media for forward secrecy). Finally, the least preferred > option > > > might be "nodevice random", although I plan to remove this in a > subsequent > > > revision. > > > > Note that I actually often run into unseeded systems when doing > development > > using qemu for non-x86 architectures. For example, when booting mips > from > > qemu, there is no loader, the kernel just starts, and since the endian is > > opposite, I frequently regenerate the filesystem using makefs. > > Isnt this also the case for bhyveload? We do not go through the loader > there when we are starting a FreeBSD guest, correct? > Bhyveload is a copy of the boot loader and runs userboot to make it happen. Warner > John Baldwin > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Wed Apr 17 17:16:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A56B1572DB8 for ; Wed, 17 Apr 2019 17:16:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F39089598 for ; Wed, 17 Apr 2019 17:16:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x744.google.com with SMTP id x18so2615705qkf.13 for ; Wed, 17 Apr 2019 10:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AzK1QqsIhvko8X6L/mAALXziKCYba6+xw/6grpAL7r0=; b=B2tapYqCXif3reFRUe1MU3/EtBoW5VNOQXrSVyu8OFto/x860UCu+LaLwIhI/jcYsX ULFgGlZfdEcYhlhgHR0L3cho/phGW6RsFzd9mU2CuOpf8wiCPX5kXie08HRCDlCO+OTi DGkqqVLMsr0c2UaroHDv1XZWVsI1lJXYHw5ZPNH+QdZo7kdxtWiaPN+b6qpjxPibxW85 Y1Sm1Vhw66hUUjAKKrgU9OKiGwDF+TcNhPDPtZOm9EVJyef7RV41kSt3EdqPKAUESQVw io/FgjlsZM1XyuRXnjj4uI6dcmJCLez9fdgbpjLlDLERxhtR12qEGPZ/Ol8ZpTXyLWFD bVXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AzK1QqsIhvko8X6L/mAALXziKCYba6+xw/6grpAL7r0=; b=PsZmqZIoc7S9WXgxFyk0oVRYWirdVPAWzy0Ro784+waLO/VaVQplG8qdYMQTQ+V28O HAeliVv+/t3Rm8p+wmbbtLysEujqejsIbuL8QaDkcjT+/DSKVnqu5Yy6kX0BcxV4HqKO 4gUoFxrc2rSRZgTFBF8/uNyhE3IkL9N+/TIirs+CbBikQ2ik6lAJYUmnbW7zNG2IXkUg HnL/O6PGQugvThuq3WDo5I6CXyNYllJUo6lABwtAy7UM1P28pHOXmtX2CEhauHEdqGAV 92ATWjRqtel0hXqLLIurXX/8viflTK+T/fA7LZ/2JbckJm6Hbb9zf9wb7wsjQ0Y9uZjF yMOQ== X-Gm-Message-State: APjAAAUkxpn+g692hCR39YixI5ZOLiiSTsns2e9HI+v4TYmCxD8/JI8h oTlxTW1XObQAHGiX3u7c8/vNpGjfgxEr7EpdgH9OAA== X-Google-Smtp-Source: APXvYqz4Vm4ZYbGY/j+WuHmwCDXc0mmegMtO26R8LwI73sUy8acjd/2RSetSHbl91Ontn02o/XZPt/9BuVHXUa1QQso= X-Received: by 2002:a37:a02:: with SMTP id 2mr25002843qkk.258.1555521413890; Wed, 17 Apr 2019 10:16:53 -0700 (PDT) MIME-Version: 1.0 References: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@FreeBSD.org> <48b25255-3d66-69fc-658b-6176ebaf4640@FreeBSD.org> In-Reply-To: <48b25255-3d66-69fc-658b-6176ebaf4640@FreeBSD.org> From: Warner Losh Date: Wed, 17 Apr 2019 11:16:42 -0600 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: John Baldwin Cc: "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 9F39089598 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.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Wed, 17 Apr 2019 17:16:55 -0000 On Wed, Apr 17, 2019 at 10:06 AM John Baldwin wrote: > On 4/16/19 4:48 PM, Conrad Meyer wrote: > > On Tue, Apr 16, 2019 at 4:31 PM John Baldwin wrote: > >> bhyveload is effectively the loader in this case. It runs the normal > loader > >> scripts and logic and so would load the guests's /boot/entropy and pass > it > >> to the guest kernel as metadata just like the regular loader. > > > > Right, except it doesn't seem to do things like nuke /boot/nextboot.conf > :-(. > > It just needs a disk write method I think for that to work, but I'm not > sure > that's currently in the userboot interface. > It isn't. Write support was added to the boot loader after bhyveload was forked. It hasn't been updated. > >> In addition, bhyve also supports virtio-rng which is another way to > provide > >> entropy to guest OS's. That's why in my reply I focused on qemu for > mips > >> (or riscv) as for x86 hypervisors there are existing, > somewhat-standarized > >> solutions for the hypervisor to provide entropy to the guest. > > > > Perhaps cryptographically random stack-protector cookies are simply > > inappropriate for MIPS or RISCV. Do we have any other examples of > > kernel random consumers blocking after that immediate hiccup is > > overcome? > > There may be MIPS and RISCV designs that do have suitable entropy available > (especially I would expect future RISCV designs to have them), so I think > blacklisting stack protector wholesale on those architectures is overboard. > I think some sort of off-by-default knob (even a compile option) is fine > for > people who need fast and loose vs safe as you already agreed to earlier. > > Also, for development testing we still want coverage of using stack cookies > on MIPS and RISCV even if the simulator environment gives not-very-strong > cookie values. I'm going to put a very fine point on this: any hard-requirement of entropy sources is a non-starter. If you require that, your commit will be backed out and/or hacked around by the addition of a nob in the future. It will happen. Don't pretend you can say 'but things weren't random enough' will carry the day. It will not. That's why I specifically requested a MD routine to be called when there's no source of entropy: that will let special needs folks do the right thing. It's also why I asked for a way to say "don't ever block waiting for entropy, soldier on the best you can, but set some variable that can be exposed to userland so that early in /etc/rc automation can be written to decide what to do when that condition exists: generate entropy and reboot, report it to some central control, nothing" since that will give the tools for different reactions. For our application it is *NEVER* OK to block the boot because there's not enough randomness. We'd rather solider on with crappy randomness and want the boot to proceed not matter what. We want the information that we had to make compromises along the way to make it happen so we can decide the right course of action for our appliances. Warner From owner-svn-src-head@freebsd.org Wed Apr 17 17:18:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A63831572E40; Wed, 17 Apr 2019 17:18:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4330189707; Wed, 17 Apr 2019 17:18:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 188DEA333; Wed, 17 Apr 2019 17:18:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HHIi6A091427; Wed, 17 Apr 2019 17:18:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HHIi3G091423; Wed, 17 Apr 2019 17:18:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904171718.x3HHIi3G091423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 17 Apr 2019 17:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346324 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4330189707 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_SHORT(-0.97)[-0.971,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)[-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: Wed, 17 Apr 2019 17:18:45 -0000 Author: kevans Date: Wed Apr 17 17:18:43 2019 New Revision: 346324 URL: https://svnweb.freebsd.org/changeset/base/346324 Log: net: adjust randomized address bits Give devices that need a MAC a 16-bit allocation out of the FreeBSD Foundation OUI range. Change the name ether_fakeaddr to ether_gen_addr now that we're dealing real MAC addresses with a real OUI rather than random locally-administered addresses. Reviewed by: bz, rgrimes Differential Revision: https://reviews.freebsd.org/D19587 Modified: head/sys/net/ethernet.h head/sys/net/ieee_oui.h head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/net/if_vxlan.c Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Wed Apr 17 17:00:16 2019 (r346323) +++ head/sys/net/ethernet.h Wed Apr 17 17:18:43 2019 (r346324) @@ -422,7 +422,7 @@ void ether_vlan_mtap(struct bpf_if *, struct mbuf *, struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, uint16_t vid, uint8_t pcp); -void ether_fakeaddr(struct ether_addr *hwaddr); +void ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr); #ifdef _SYS_EVENTHANDLER_H_ /* new ethernet interface attached event */ Modified: head/sys/net/ieee_oui.h ============================================================================== --- head/sys/net/ieee_oui.h Wed Apr 17 17:00:16 2019 (r346323) +++ head/sys/net/ieee_oui.h Wed Apr 17 17:18:43 2019 (r346324) @@ -67,3 +67,14 @@ /* Allocate 20 bits to bhyve */ #define OUI_FREEBSD_BHYVE_LOW OUI_FREEBSD(0x000001) #define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD(0x0fffff) + +/* + * Allocate 16 bits for a pool to give to various interfaces that need a + * generated address, but don't quite need to slice off a whole section of + * the OUI (e.g. cloned interfaces, one-off NICs of various vendors). + * + * ether_gen_addr should be used to generate an address from this pool. + */ +#define OUI_FREEBSD_GENERATED_MASK 0x10ffff +#define OUI_FREEBSD_GENERATED_LOW OUI_FREEBSD(0x100000) +#define OUI_FREEBSD_GENERATED_HIGH OUI_FREEBSD(OU_FREEBSD_GENERATED_MASK) Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Wed Apr 17 17:00:16 2019 (r346323) +++ head/sys/net/if_bridge.c Wed Apr 17 17:18:43 2019 (r346324) @@ -671,7 +671,7 @@ bridge_clone_create(struct if_clone *ifc, int unit, ca getcredhostid(curthread->td_ucred, &hostid); do { if (fb || hostid == 0) { - ether_fakeaddr(&sc->sc_defaddr); + ether_gen_addr(ifp, &sc->sc_defaddr); } else { sc->sc_defaddr.octet[0] = 0x2; sc->sc_defaddr.octet[1] = (hostid >> 24) & 0xff; Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Wed Apr 17 17:00:16 2019 (r346323) +++ head/sys/net/if_ethersubr.c Wed Apr 17 17:18:43 2019 (r346324) @@ -42,11 +42,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -54,6 +56,7 @@ #include #include +#include #include #include #include @@ -85,6 +88,8 @@ #endif #include +#include + #ifdef CTASSERT CTASSERT(sizeof (struct ether_header) == ETHER_ADDR_LEN * 2 + 2); CTASSERT(sizeof (struct ether_addr) == ETHER_ADDR_LEN); @@ -1401,19 +1406,37 @@ ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, return (true); } +/* + * Allocate an address from the FreeBSD Foundation OUI. This uses a + * cryptographic hash function on the containing jail's UUID and the interface + * name to attempt to provide a unique but stable address. Pseudo-interfaces + * which require a MAC address should use this function to allocate + * non-locally-administered addresses. + */ void -ether_fakeaddr(struct ether_addr *hwaddr) +ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr) { +#define ETHER_GEN_ADDR_BUFSIZ HOSTUUIDLEN + IFNAMSIZ + 2 + SHA1_CTX ctx; + char buf[ETHER_GEN_ADDR_BUFSIZ]; + char uuid[HOSTUUIDLEN + 1]; + uint64_t addr; + int i, sz; + char digest[SHA1_RESULTLEN]; - /* - * Generate a convenient locally administered address, - * 'bsd' + random 24 low-order bits. 'b' is 0x62, which has the locally - * assigned bit set, and the broadcast/multicast bit clear. - */ - arc4rand(hwaddr->octet, ETHER_ADDR_LEN, 1); - hwaddr->octet[0] = 'b'; - hwaddr->octet[1] = 's'; - hwaddr->octet[2] = 'd'; + getcredhostuuid(curthread->td_ucred, uuid, sizeof(uuid)); + sz = snprintf(buf, ETHER_GEN_ADDR_BUFSIZ, "%s-%s", uuid, ifp->if_xname); + SHA1Init(&ctx); + SHA1Update(&ctx, buf, sz); + SHA1Final(digest, &ctx); + + addr = ((digest[0] << 16) | (digest[1] << 8) | digest[2]) & + OUI_FREEBSD_GENERATED_MASK; + addr = OUI_FREEBSD(addr); + for (i = 0; i < ETHER_ADDR_LEN; ++i) { + hwaddr->octet[i] = addr >> ((ETHER_ADDR_LEN - i - 1) * 8) & + 0xFF; + } } DECLARE_MODULE(ether, ether_mod, SI_SUB_INIT_IF, SI_ORDER_ANY); Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Wed Apr 17 17:00:16 2019 (r346323) +++ head/sys/net/if_vxlan.c Wed Apr 17 17:18:43 2019 (r346324) @@ -2754,7 +2754,7 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&sc->vxl_media, IFM_ETHER | IFM_AUTO); - ether_fakeaddr(&sc->vxl_hwaddr); + ether_gen_addr(ifp, &sc->vxl_hwaddr); ether_ifattach(ifp, sc->vxl_hwaddr.octet); ifp->if_baudrate = 0; From owner-svn-src-head@freebsd.org Wed Apr 17 17:19:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A14221572F04; Wed, 17 Apr 2019 17:19:55 +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 4297A899C3; Wed, 17 Apr 2019 17:19:55 +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 1F299A361; Wed, 17 Apr 2019 17:19:55 +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 x3HHJtro091587; Wed, 17 Apr 2019 17:19:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HHJsp6091586; Wed, 17 Apr 2019 17:19:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904171719.x3HHJsp6091586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 17 Apr 2019 17:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346326 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 346326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4297A899C3 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)[-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: Wed, 17 Apr 2019 17:19:55 -0000 Author: kevans Date: Wed Apr 17 17:19:54 2019 New Revision: 346326 URL: https://svnweb.freebsd.org/changeset/base/346326 Log: iflib: Use new ether_gen_addr, restricting addresses to that subset Differential Revision: https://reviews.freebsd.org/D19587 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Apr 17 17:19:19 2019 (r346325) +++ head/sys/net/iflib.c Wed Apr 17 17:19:54 2019 (r346326) @@ -37,15 +37,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include #include #include #include #include -#include #include #include #include @@ -207,7 +204,7 @@ struct iflib_ctx { #define isc_legacy_intr ifc_txrx.ift_legacy_intr eventhandler_tag ifc_vlan_attach_event; eventhandler_tag ifc_vlan_detach_event; - uint8_t ifc_mac[ETHER_ADDR_LEN]; + struct ether_addr ifc_mac; char ifc_mtx_name[16]; }; @@ -250,7 +247,7 @@ void iflib_set_mac(if_ctx_t ctx, uint8_t mac[ETHER_ADDR_LEN]) { - bcopy(mac, ctx->ifc_mac, ETHER_ADDR_LEN); + bcopy(mac, ctx->ifc_mac.octet, ETHER_ADDR_LEN); } if_softc_ctx_t @@ -1276,38 +1273,6 @@ prefetch2cachelines(void *x) #endif static void -iflib_gen_mac(if_ctx_t ctx) -{ - struct thread *td; - MD5_CTX mdctx; - char uuid[HOSTUUIDLEN+1]; - char buf[HOSTUUIDLEN+16]; - uint8_t *mac; - unsigned char digest[16]; - - td = curthread; - mac = ctx->ifc_mac; - uuid[HOSTUUIDLEN] = 0; - bcopy(td->td_ucred->cr_prison->pr_hostuuid, uuid, HOSTUUIDLEN); - snprintf(buf, HOSTUUIDLEN+16, "%s-%s", uuid, device_get_nameunit(ctx->ifc_dev)); - /* - * Generate a pseudo-random, deterministic MAC - * address based on the UUID and unit number. - * The FreeBSD Foundation OUI of 58-9C-FC is used. - */ - MD5Init(&mdctx); - MD5Update(&mdctx, buf, strlen(buf)); - MD5Final(digest, &mdctx); - - mac[0] = 0x58; - mac[1] = 0x9C; - mac[2] = 0xFC; - mac[3] = digest[0]; - mac[4] = digest[1]; - mac[5] = digest[2]; -} - -static void iru_init(if_rxd_update_t iru, iflib_rxq_t rxq, uint8_t flid) { iflib_fl_t fl; @@ -4579,7 +4544,7 @@ iflib_device_register(device_t dev, void *sc, if_share } } - ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac); + ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); if ((err = IFDI_ATTACH_POST(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err); @@ -4668,7 +4633,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc goto fail_unlock; } if (sctx->isc_flags & IFLIB_GEN_MAC) - iflib_gen_mac(ctx); + ether_gen_addr(ifp, &ctx->ifc_mac); if ((err = IFDI_CLONEATTACH(ctx, clctx->cc_ifc, clctx->cc_name, clctx->cc_params)) != 0) { device_printf(dev, "IFDI_CLONEATTACH failed %d\n", err); @@ -4689,7 +4654,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc ifp->if_flags |= IFF_NOGROUP; if (sctx->isc_flags & IFLIB_PSEUDO) { - ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac); + ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); if ((err = IFDI_ATTACH_POST(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err); @@ -4796,7 +4761,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc /* * XXX What if anything do we want to do about interrupts? */ - ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac); + ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); if ((err = IFDI_ATTACH_POST(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err); goto fail_detach; From owner-svn-src-head@freebsd.org Wed Apr 17 17:30:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00D5315737E3; Wed, 17 Apr 2019 17:30:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92FB68A311; Wed, 17 Apr 2019 17:30:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id f22so5686793ita.3; Wed, 17 Apr 2019 10:30:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=jqZvV7uXjg9GSxh31V27bRdpI0JW3VVN1ga39jurcII=; b=U30HBo3k798EXetekclTI5JSENg3WkMWobZZQ06tdrzgyVZtywaH30OcBu2mwCPvNw hse0oilMC0emjI3jlVJ9LYlx0Js38JyRQtM+jjoQUHNrRlZP1LS1qoujM3FCL5Fcw15F 3B9N9BsSTNKU/8gVu4kNHC4uS5tDYRgfLrcZSvmByV51oOnMTD44NiWvquznucBtZI/U bD3rRJKGJ5q/VoBoCWQn9UklhBNyD0ssaUB7st/u8AzCgRQryHFMU6m1WiKcmB4Xp2uu TmDgNUj9Oyt1d322WeVu7ZdEOksoRZgxu0//5EiOIuo9cblJr7DVRwtiMmHAHCamRZUF 16nQ== X-Gm-Message-State: APjAAAXxi8nszGK0lTl1vDXhL1srMCahfAA/+bV5uUJ+vNsWdCoZ5W+z Rrrr7nBHZPjNQJGephH7mcF4GITU X-Google-Smtp-Source: APXvYqyD8Mw4Q2czp1UMpLpq4EQv1zklhnlXzrp1CCFUBNV/uXNnIACLV/Suv9H6pPe6RR89DNi8eA== X-Received: by 2002:a24:5447:: with SMTP id t68mr797920ita.28.1555522249319; Wed, 17 Apr 2019 10:30:49 -0700 (PDT) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com. [209.85.166.50]) by smtp.gmail.com with ESMTPSA id b17sm21469444ion.0.2019.04.17.10.30.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 10:30:49 -0700 (PDT) Received: by mail-io1-f50.google.com with SMTP id v4so21283220ioj.5; Wed, 17 Apr 2019 10:30:49 -0700 (PDT) X-Received: by 2002:a6b:691a:: with SMTP id e26mr31309579ioc.124.1555522249032; Wed, 17 Apr 2019 10:30:49 -0700 (PDT) MIME-Version: 1.0 References: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@FreeBSD.org> <48b25255-3d66-69fc-658b-6176ebaf4640@FreeBSD.org> In-Reply-To: <48b25255-3d66-69fc-658b-6176ebaf4640@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 17 Apr 2019 10:30:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 92FB68A311 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.980,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Wed, 17 Apr 2019 17:30:56 -0000 On Wed, Apr 17, 2019 at 9:06 AM John Baldwin wrote: > > On 4/16/19 4:48 PM, Conrad Meyer wrote: > > Perhaps cryptographically random stack-protector cookies are simply > > inappropriate for MIPS or RISCV. Do we have any other examples of > > kernel random consumers blocking after that immediate hiccup is > > overcome? > > There may be MIPS and RISCV designs that do have suitable entropy available > (especially I would expect future RISCV designs to have them), so I think > blacklisting stack protector wholesale on those architectures is overboard. The difficulty is how early __stack_chk_init runs vs when entropy might be available. If some MIPS or RISCV design shows up with a fast HWRNG source, great! > I think some sort of off-by-default knob (even a compile option) is fine for > people who need fast and loose vs safe as you already agreed to earlier. > > Also, for development testing we still want coverage of using stack cookies > on MIPS and RISCV even if the simulator environment gives not-very-strong > cookie values. Right. There's a difference between removing random stack cookies and removing stack cookies entirely; I agree some benefit remains for development. Best, Conrad From owner-svn-src-head@freebsd.org Wed Apr 17 17:44:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC35A1573FA7; Wed, 17 Apr 2019 17:44:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76BE88AD41; Wed, 17 Apr 2019 17:44:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f194.google.com with SMTP id f22so5767409ita.3; Wed, 17 Apr 2019 10:44:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=N0LHj1zKA1tsqFuEKQ471jQTsnOmHDs7uuv69zXbhXM=; b=jv1nnDHkN1blCY+zm57NPd4Tm/BgEoFVYiOBlCAs5ARxAlce6oaBMaROYFqXbl2axB b1BONVWWE/D5XAhHjzcCDxWM2AlD5HKUtGEf0mpIF/nLvBQYiteRqs6HuGEchrYhVfur gXIqkkpQ03kYe5lCv9lltizPuRNyLgyB7n/UKb+hn25AXgtzg8BtgkpL9j4HznJt0FCV H8BgGkWfvK2bGacXcqDgFAbag9iUMQIjBSArcWKlZWU4THCHwlQkWEWrZSgurNZ2Dtik /8Ln+lvmrt3wtid/k5iOxHyVfcOHWVPWeOsJ06pwkrfcXEeMHkvKwAuGTlBtRsn5l2KG bHjQ== X-Gm-Message-State: APjAAAVvo9XXiUAIt/M9gAI2aeuoyQgR98bFStL6gXYIoniPDbiv/zah 6FhuEfu3O9O6YybmKIUfVebI0pGx X-Google-Smtp-Source: APXvYqyJ2Jt3snTOqh1L1f0YCe6JNn+wAhh41f65bZ/Ic0PLHLEzcKn8BxcwLDqdFvyEMaRF7gH2DQ== X-Received: by 2002:a24:68c2:: with SMTP id v185mr720348itb.94.1555522571090; Wed, 17 Apr 2019 10:36:11 -0700 (PDT) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com. [209.85.166.41]) by smtp.gmail.com with ESMTPSA id m132sm21391683ioa.53.2019.04.17.10.36.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 10:36:10 -0700 (PDT) Received: by mail-io1-f41.google.com with SMTP id x3so21239776iol.10; Wed, 17 Apr 2019 10:36:10 -0700 (PDT) X-Received: by 2002:a6b:691a:: with SMTP id e26mr31328433ioc.124.1555522570364; Wed, 17 Apr 2019 10:36:10 -0700 (PDT) MIME-Version: 1.0 References: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@FreeBSD.org> <48b25255-3d66-69fc-658b-6176ebaf4640@FreeBSD.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 17 Apr 2019 10:35:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 76BE88AD41 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.981,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Wed, 17 Apr 2019 17:44:26 -0000 Hi Warner, On Wed, Apr 17, 2019 at 10:16 AM Warner Losh wrote: > I'm going to put a very fine point on this: any hard-requirement of entro= py sources is a non-starter. If you require that, your commit will be backe= d out and/or hacked around by the addition of a nob in the future. It will = happen. Don't pretend you can say 'but things weren't random enough' will c= arry the day. It will not. > > That's why I specifically requested a MD routine to be called when there'= s no source of entropy: that will let special needs folks do the right thin= g. It's also why I asked for a way to say "don't ever block waiting for ent= ropy, soldier on the best you can, but set some variable that can be expose= d to userland so that early in /etc/rc automation can be written to decide = what to do when that condition exists: generate entropy and reboot, report = it to some central control, nothing" since that will give the tools for dif= ferent reactions. > > For our application it is *NEVER* OK to block the boot because there's no= t enough randomness. We'd rather solider on with crappy randomness and want= the boot to proceed not matter what. We want the information that we had t= o make compromises along the way to make it happen so we can decide the rig= ht course of action for our appliances. I think John's proposed big knob to disable hard-requirement of entropy, and a warning on dmesg, pretty much covers your applications' needs. Do you agree? The random framework has already got ways to register random sources; special needs MD folks can always register their own fako fast random source. I.e., the randomdev entropy intake framework is already general with room for MD-specific drivers (of which several exist today). Take care, Conrad From owner-svn-src-head@freebsd.org Wed Apr 17 17:47:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0B2D15740F2 for ; Wed, 17 Apr 2019 17:47:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC6B8AF30 for ; Wed, 17 Apr 2019 17:47:11 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555522260; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=UA43IoB+ljSxZWNdt8z8c02RicS5oOO1AiIrOOoCVr/xOLVCKZnYJ/fgvg4+ZyCJaEK7B+K3VCqqA 2ZKpUQRN5wu4BWQS7kzIY4HsfX/DYCIMfQzYCplJbY4Bq54oIZ9OoAl1h4C6uqv2rujGiji8Y1mKr3 GQitTQrmhkZg+0ty59JQCrPE1bxX2loCB0EnLfuAam22M+b2V0grsuoWtlOQC6l4un0nmdn2UfseD8 kf8GOPzPpRfj/vhUHniTlpASLjLNzNN+gZ0l2rqFdSyZaXBIfZ8j28JMpyyXRsbm+61fIlF10yrN2Z v0nIPKKDh0ZWClcu1DEzKZDFePZBgDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=C/lvUl4nM5Ri2eeM6ee2kNdj9jNLip6kilaqv+O7BUw=; b=GO3Xh0N1DWKXy70MFcXenepvnKtpJ7vYFigTzko61Dg60BoCWkoRKX44LUSHrWMN7VfH4V7OvmTi8 G8+bq1UEPvo8GrRKBzjDo9sExzMJ0RoVu3hu8ujnzhORvVh1unz6GkCE4VNMnhmsCC0oFNJgRivtO6 Fs+rhZJyWUWopcmEsIWSOcihBji4SkZkeBVjfCr44NphNV2jA7Vgd0biDmlQN8joj1JZ77dwvaIX0R 79c7ckBMBN53f5AvhdfaxF33sDwUB0KZzCYmpXytQiRGo1u9dgxFLRtm74Fwi/ZxHQ0wOVMe/xzjHm 4jfLicFmjAhHrJZQf7XaDZUyjtUe0sw== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=C/lvUl4nM5Ri2eeM6ee2kNdj9jNLip6kilaqv+O7BUw=; b=vmiSwwjG/OgGe5Pl5o+3pVSy7WBWMaKinqHItQ2Xkxk3+Cl7O21JJ+9BMV9ityUrgl1YtrbE7EWhb MQUjZSdjaP3SQuIe3OvZbg9vIHMKVTmtRIfaqf4aNGY8MVCY/oJE2FD35/c/mo/eefztarLYN2HvMN JiJWRlhRkkZaA3BIU+otppjm64ZbaTdg1vRdMpmFLmFxMP8mICEBn8nPjInMgFQgenWdGSiFlrUKvz aqRUeQvDIMSN+0FeSltoZNwJ8Un09u81YVSNfYOl8EKwjYNAb6Gpe0I9ItxaCeUjTO7TXf68Jlba/8 9VRhtE9d1Lqimg068H9Bbk0RlStisVw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 8febce89-6136-11e9-990e-673a89bc4518 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 8febce89-6136-11e9-990e-673a89bc4518; Wed, 17 Apr 2019 17:30:59 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3HHUvCE047206; Wed, 17 Apr 2019 11:30:58 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <78a8423ede681a7ab6572c508ec800d9cffb562b.camel@freebsd.org> Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys From: Ian Lepore To: Warner Losh , John Baldwin Cc: "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Date: Wed, 17 Apr 2019 11:30:57 -0600 In-Reply-To: References: <201904162251.x3GMp2aF097103@gndrsh.dnsmgr.net> <4d6b8a14-b053-9ed1-14b2-bbc359ac9413@FreeBSD.org> <48b25255-3d66-69fc-658b-6176ebaf4640@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2DC6B8AF30 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.991,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, 17 Apr 2019 17:47:12 -0000 On Wed, 2019-04-17 at 11:16 -0600, Warner Losh wrote: > On Wed, Apr 17, 2019 at 10:06 AM John Baldwin wrote: > > > On 4/16/19 4:48 PM, Conrad Meyer wrote: > > > On Tue, Apr 16, 2019 at 4:31 PM John Baldwin wrote: > > > > bhyveload is effectively the loader in this case. It runs the normal > > > > loader > > > > scripts and logic and so would load the guests's /boot/entropy and pass > > > > it > > > > to the guest kernel as metadata just like the regular loader. > > > > > > Right, except it doesn't seem to do things like nuke /boot/nextboot.conf > > > > :-(. > > > > It just needs a disk write method I think for that to work, but I'm not > > sure > > that's currently in the userboot interface. > > > > It isn't. Write support was added to the boot loader after bhyveload was > forked. It hasn't been updated. > > > > > > In addition, bhyve also supports virtio-rng which is another way to > > > > provide > > > > entropy to guest OS's. That's why in my reply I focused on qemu for > > > > mips > > > > (or riscv) as for x86 hypervisors there are existing, > > > > somewhat-standarized > > > > solutions for the hypervisor to provide entropy to the guest. > > > > > > Perhaps cryptographically random stack-protector cookies are simply > > > inappropriate for MIPS or RISCV. Do we have any other examples of > > > kernel random consumers blocking after that immediate hiccup is > > > overcome? > > > > There may be MIPS and RISCV designs that do have suitable entropy available > > (especially I would expect future RISCV designs to have them), so I think > > blacklisting stack protector wholesale on those architectures is overboard. > > I think some sort of off-by-default knob (even a compile option) is fine > > for > > people who need fast and loose vs safe as you already agreed to earlier. > > > > Also, for development testing we still want coverage of using stack cookies > > on MIPS and RISCV even if the simulator environment gives not-very-strong > > cookie values. > > > I'm going to put a very fine point on this: any hard-requirement of entropy > sources is a non-starter. If you require that, your commit will be backed > out and/or hacked around by the addition of a nob in the future. It will > happen. Don't pretend you can say 'but things weren't random enough' will > carry the day. It will not. > > That's why I specifically requested a MD routine to be called when there's > no source of entropy: that will let special needs folks do the right thing. > It's also why I asked for a way to say "don't ever block waiting for > entropy, soldier on the best you can, but set some variable that can be > exposed to userland so that early in /etc/rc automation can be written to > decide what to do when that condition exists: generate entropy and reboot, > report it to some central control, nothing" since that will give the tools > for different reactions. > > For our application it is *NEVER* OK to block the boot because there's not > enough randomness. We'd rather solider on with crappy randomness and want > the boot to proceed not matter what. We want the information that we had to > make compromises along the way to make it happen so we can decide the right > course of action for our appliances. > > Warner I'll add a big +1 to all of that, it all directly applies to our embedded products at $work as well, and would give us the control we need to handle things in an application-specific way. -- Ian From owner-svn-src-head@freebsd.org Wed Apr 17 17:50:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78E4815741B7; Wed, 17 Apr 2019 17:50:45 +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 1D9B78B23B; Wed, 17 Apr 2019 17:50:45 +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 E2E80A89B; Wed, 17 Apr 2019 17:50:44 +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 x3HHoiUU006960; Wed, 17 Apr 2019 17:50:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HHoicp006959; Wed, 17 Apr 2019 17:50:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171750.x3HHoicp006959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 17:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346327 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 346327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D9B78B23B 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]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 17 Apr 2019 17:50:45 -0000 Author: emaste Date: Wed Apr 17 17:50:44 2019 New Revision: 346327 URL: https://svnweb.freebsd.org/changeset/base/346327 Log: readelf: use size_t for object counts PR: 212539 Reported by: cem Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Apr 17 17:19:54 2019 (r346326) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Apr 17 17:50:44 2019 (r346327) @@ -370,7 +370,7 @@ static void readelf_usage(int status); static void readelf_version(void); static void search_loclist_at(struct readelf *re, Dwarf_Die die, Dwarf_Unsigned lowpc, struct loc_at **la_list, - unsigned int *la_list_len, unsigned int *la_list_cap); + size_t *la_list_len, size_t *la_list_cap); static void search_ver(struct readelf *re); static const char *section_type(unsigned int mach, unsigned int stype); static void set_cu_context(struct readelf *re, Dwarf_Half psize, @@ -6063,8 +6063,7 @@ loc_at_comparator(const void *la1, const void *la2) static void search_loclist_at(struct readelf *re, Dwarf_Die die, Dwarf_Unsigned lowpc, - struct loc_at **la_list, unsigned int *la_list_len, - unsigned int *la_list_cap) + struct loc_at **la_list, size_t *la_list_len, size_t *la_list_cap) { struct loc_at *la; Dwarf_Attribute *attr_list; @@ -6438,7 +6437,8 @@ dump_dwarf_loclist(struct readelf *re) Dwarf_Half tag, version, pointer_size, off_size; Dwarf_Error de; struct loc_at *la_list, *left, *right, *la; - unsigned int la_list_len, la_list_cap, duplicates, k; + size_t la_list_len, la_list_cap; + unsigned int duplicates, k; int i, j, ret, has_content; la_list_len = 0; From owner-svn-src-head@freebsd.org Wed Apr 17 17:57:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CABCF157457B; Wed, 17 Apr 2019 17:57:16 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40C838B719; Wed, 17 Apr 2019 17:57:15 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1555523826; bh=H1Ug1rWhhWg3pouBuYjnhp98CxU1Ql3ad+c7f73/xec=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=CBu+0rRP/owjsm5u4jIsWkMO8xi0rUPu8sffKEy/8y6TXXxs83XegKHHBLGB+kzqK YPv95nGUfqSPU0YGhAuskAhnDo+cBh/LeiKLUBdGaLnAfJMch++9pV76t4kSCEICkk 78G9L7K3j1K36VPN10HKN1aeD2PMHHcD+f+K9lys= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from thor.intern.walstatt.dynvpn.de ([89.12.18.195]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mh6lB-1hTgls0D4b-00MKKv; Wed, 17 Apr 2019 19:51:53 +0200 Date: Wed, 17 Apr 2019 19:51:18 +0200 From: "O. Hartmann" To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc Message-ID: <20190417195145.6824c0f9@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201904171618.x3HGIERC059575@repo.freebsd.org> References: <201904171618.x3HGIERC059575@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:XAajlszpofkuWjQS0owKBWbpS0F71Cll1llhLZehwcKYwpTFfeE 1uFLskOY+9UTE42via8Oado3fSOVEiBUwu/XlrIg/U5II9u1yNvUdusOhQbG5wSEO750q8m ckD+Jmv6OeotKNjMapTgvK1hXdQ768Cc1rtUbmdIi9BaYTU3V50Kj+7IoIZd3d5R35GIg9R FJLlveYDkNr9GKOHfK4zw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:BW4aerVCrMo=:LH/8RkDZonWKNie7LBy1x2 vcUOy78irze7PW3lbQccCZFQK6KvirxLT+Olm5Xa6lCQhtZXOUgL4kDsiwDaYv8VLjRnkoZoT 0R5CYNy3B2vjIl23OVpLAwX5WWjpnht+0NkcxrQ874UmLA1GCljCsSL7cDjkYF2t3SqVvzCWY TiRAdNSDqSRRU+e47iv97S2P3PLCbqlcarn/eybR8WCN7+7RW0xWNVTsbv+VRqipCzVC0piam VNLSGZgBrVFBKvuuAGQpB1DnA+pTGF+euy8P4D3igVbTSwUdeILUiXt5KLP6FkHxwRUEfr65L BHfODs7jKEIgb0lgyFyDuYne2by3xHDFZg431G8WytXK2RMD2dAWgoNkLwxrF2o2VG68lrvwo /GAb62CeILMgqmqqjh+ApJU9XIilE8a9cqsyQ52AQREd7qRgbkIgxRAS+/6uYo8t7RtvasuB8 nRYJhHPANpWaDtvrPslxwXQs1N/Ld+/hVkXX1W0AbKqqe3kHgCG9lvD79SGiD6bzXLPOjfZ91 I7N8fYDnXDbrTbCCdFJbReyWLOAb8gA6zKirmQCW0Xxc/hAFfKOW9aPYESM0g6j/8hLXbVuXK c6NvbH2ymGPxG3viUrZfUx2aHK5oiBYNrc5sH7skEENOxBQQQAbTM1TydFcTcaZx0O6517clZ iJ02LNWSnyVsI9WNF0iZFwdE+2GNkoD8uIPmYJP1jYXzIZSSFgMu/hYT7Znmfo2w0OD05oetn 1Eor7F2qpvK/Q/Mpc6/EpT2XE2feHKsWDV86abpYaotvW0i9S9wjUWg4MnpOuo7NByFL+c5o/ UIfMgrQOD3T0/NfZ5PVQ24l4Zh2BlFxpjkwis6H7zKILVFxVwGfoDMMvLD+YzxVjEWU+4PNbP 9KDkFirdjZgLWh/FSMogAgHG26XFa9BmnUSoQn1G0Ya+DTCQVr9HDUmBLaOH/MLA1JDK+zU9s N9fYjnZjVwA== X-Rspamd-Queue-Id: 40C838B719 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.989,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, 17 Apr 2019 17:57:17 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIFdl ZCwgMTcgQXByIDIwMTkgMTY6MTg6MTQgKzAwMDAgKFVUQykNCkVkIE1hc3RlIDxlbWFzdGVARnJl ZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiBlbWFzdGUNCj4gRGF0ZTogV2VkIEFwciAx NyAxNjoxODoxNCAyMDE5DQo+IE5ldyBSZXZpc2lvbjogMzQ2MzE2DQo+IFVSTDogaHR0cHM6Ly9z dm53ZWIuZnJlZWJzZC5vcmcvY2hhbmdlc2V0L2Jhc2UvMzQ2MzE2DQo+IA0KPiBMb2c6DQo+ICAg Y2FwX2ZpbGVhcmdzOiBjaGFzZSByMzQ2MzE1LCB1cGRhdGUgZmlsZWFyZ3NfaW5pdCBpbiBjb25z dW1lcnMNCj4gICANCj4gICBSZXBvcnRlZCBieToJY2kuZnJlZWJzZC5vcmcgKDggdGltZXMgc28g ZmFyKQ0KPiAgIE1GQyBhZnRlcjoJMyB3ZWVrcw0KPiAgIE1GQyB3aXRoOglyMzQ2MzE1DQo+ICAg U3BvbnNvcmVkIGJ5OglUaGUgRnJlZUJTRCBGb3VuZGF0aW9uDQo+IA0KPiBNb2RpZmllZDoNCj4g ICBoZWFkL2NvbnRyaWIvZWxmdG9vbGNoYWluL3N0cmluZ3Mvc3RyaW5ncy5jDQo+ICAgaGVhZC9z YmluL3NhdmVjb3JlL3NhdmVjb3JlLmMNCj4gICBoZWFkL3Vzci5iaW4vYnJhbmRlbGYvYnJhbmRl bGYuYw0KPiAgIGhlYWQvdXNyLmJpbi9oZWFkL2hlYWQuYw0KPiAgIGhlYWQvdXNyLmJpbi93Yy93 Yy5jDQo+IA0KPiBNb2RpZmllZDogaGVhZC9jb250cmliL2VsZnRvb2xjaGFpbi9zdHJpbmdzL3N0 cmluZ3MuYw0KPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQvY29udHJpYi9lbGZ0 b29sY2hhaW4vc3RyaW5ncy9zdHJpbmdzLmMJV2VkIEFwciAxNyAxNjowMjo1NyAyMDE5DQo+IChy MzQ2MzE1KSArKysgaGVhZC9jb250cmliL2VsZnRvb2xjaGFpbi9zdHJpbmdzL3N0cmluZ3MuYwlX ZWQgQXByIDE3IDE2OjE4OjE0DQo+IDIwMTkJKHIzNDYzMTYpIEBAIC0xOTUsNyArMTk1LDcgQEAg bWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpDQo+ICAJYXJndiArPSBvcHRpbmQ7DQo+ICANCj4g IAljYXBfcmlnaHRzX2luaXQoJnJpZ2h0cywgQ0FQX1JFQUQsIENBUF9TRUVLLCBDQVBfRlNUQVQs IENBUF9GQ05UTCk7DQo+IC0JZmEgPSBmaWxlYXJnc19pbml0KGFyZ2MsIGFyZ3YsIE9fUkRPTkxZ LCAwLCAmcmlnaHRzKTsNCj4gKwlmYSA9IGZpbGVhcmdzX2luaXQoYXJnYywgYXJndiwgT19SRE9O TFksIDAsICZyaWdodHMsIEZBX09QRU4pOw0KPiAgCWlmIChmYSA9PSBOVUxMKQ0KPiAgCQllcnIo MSwgIlVuYWJsZSB0byBpbml0aWFsaXplIGNhc3BlciBmaWxlYXJncyIpOw0KPiAgDQo+IA0KPiBN b2RpZmllZDogaGVhZC9zYmluL3NhdmVjb3JlL3NhdmVjb3JlLmMNCj4gPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09DQo+IC0tLSBoZWFkL3NiaW4vc2F2ZWNvcmUvc2F2ZWNvcmUuYwlXZWQgQXByIDE3IDE2 OjAyOjU3IDIwMTkJKHIzNDYzMTUpDQo+ICsrKyBoZWFkL3NiaW4vc2F2ZWNvcmUvc2F2ZWNvcmUu YwlXZWQgQXByIDE3IDE2OjE4OjE0IDIwMTkJKHIzNDYzMTYpDQo+IEBAIC0xMDMwLDcgKzEwMzAs NyBAQCBpbml0X2NhcHMoaW50IGFyZ2MsIGNoYXIgKiphcmd2KQ0KPiAgCSAqLw0KPiAgCSh2b2lk KWNhcF9yaWdodHNfaW5pdCgmcmlnaHRzLCBDQVBfUFJFQUQsIENBUF9XUklURSwgQ0FQX0lPQ1RM KTsNCj4gIAljYXBmYSA9IGZpbGVhcmdzX2luaXQoYXJnYywgYXJndiwgY2hlY2tmb3IgfHwga2Vl cCA/IE9fUkRPTkxZIDogT19SRFdSLA0KPiAtCSAgICAwLCAmcmlnaHRzKTsNCj4gKwkgICAgMCwg JnJpZ2h0cywgRkFfT1BFTik7DQo+ICAJaWYgKGNhcGZhID09IE5VTEwpIHsNCj4gIAkJbG9nbXNn KExPR19FUlIsICJmaWxlYXJnc19pbml0KCk6ICVtIik7DQo+ICAJCWV4aXQoMSk7DQo+IA0KPiBN b2RpZmllZDogaGVhZC91c3IuYmluL2JyYW5kZWxmL2JyYW5kZWxmLmMNCj4gPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09DQo+IC0tLSBoZWFkL3Vzci5iaW4vYnJhbmRlbGYvYnJhbmRlbGYuYwlXZWQgQXBy IDE3IDE2OjAyOjU3IDIwMTkJKHIzNDYzMTUpDQo+ICsrKyBoZWFkL3Vzci5iaW4vYnJhbmRlbGYv YnJhbmRlbGYuYwlXZWQgQXByIDE3IDE2OjE4OjE0IDIwMTkJKHIzNDYzMTYpDQo+IEBAIC0xMzMs NyArMTMzLDcgQEAgbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpDQo+ICAJaWYgKGZsYWdzID09 IE9fUkRXUikNCj4gIAkJY2FwX3JpZ2h0c19zZXQoJnJpZ2h0cywgQ0FQX1dSSVRFKTsNCj4gIA0K PiAtCWZhID0gZmlsZWFyZ3NfaW5pdChhcmdjLCBhcmd2LCBmbGFncywgMCwgJnJpZ2h0cyk7DQo+ ICsJZmEgPSBmaWxlYXJnc19pbml0KGFyZ2MsIGFyZ3YsIGZsYWdzLCAwLCAmcmlnaHRzLCBGQV9P UEVOKTsNCj4gIAlpZiAoZmEgPT0gTlVMTCkNCj4gIAkJZXJyeCgxLCAidW5hYmxlIHRvIGluaXQg Y2FzcGVyIik7DQo+ICANCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3Vzci5iaW4vaGVhZC9oZWFkLmMN Cj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3Vzci5iaW4vaGVhZC9oZWFkLmMJ V2VkIEFwciAxNyAxNjowMjo1NyAyMDE5CShyMzQ2MzE1KQ0KPiArKysgaGVhZC91c3IuYmluL2hl YWQvaGVhZC5jCVdlZCBBcHIgMTcgMTY6MTg6MTQgMjAxOQkocjM0NjMxNikNCj4gQEAgLTExNSw3 ICsxMTUsNyBAQCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQo+ICAJYXJndiArPSBvcHRp bmQ7DQo+ICANCj4gIAlmYSA9IGZpbGVhcmdzX2luaXQoYXJnYywgYXJndiwgT19SRE9OTFksIDAs DQo+IC0JICAgIGNhcF9yaWdodHNfaW5pdCgmcmlnaHRzLCBDQVBfUkVBRCwgQ0FQX0ZTVEFULCBD QVBfRkNOVEwpKTsNCj4gKwkgICAgY2FwX3JpZ2h0c19pbml0KCZyaWdodHMsIENBUF9SRUFELCBD QVBfRlNUQVQsIENBUF9GQ05UTCksIEZBX09QRU4pOw0KPiAgCWlmIChmYSA9PSBOVUxMKQ0KPiAg CQllcnJ4KDEsICJ1bmFibGUgdG8gaW5pdCBjYXNwZXIiKTsNCj4gIA0KPiANCj4gTW9kaWZpZWQ6 IGhlYWQvdXNyLmJpbi93Yy93Yy5jDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVh ZC91c3IuYmluL3djL3djLmMJV2VkIEFwciAxNyAxNjowMjo1NyAyMDE5CShyMzQ2MzE1KQ0KPiAr KysgaGVhZC91c3IuYmluL3djL3djLmMJV2VkIEFwciAxNyAxNjoxODoxNCAyMDE5CShyMzQ2MzE2 KQ0KPiBAQCAtMTMzLDcgKzEzMyw3IEBAIG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkNCj4g IAkodm9pZClzaWduYWwoU0lHSU5GTywgc2lnaW5mb19oYW5kbGVyKTsNCj4gIA0KPiAgCWZhID0g ZmlsZWFyZ3NfaW5pdChhcmdjLCBhcmd2LCBPX1JET05MWSwgMCwNCj4gLQkgICAgY2FwX3JpZ2h0 c19pbml0KCZyaWdodHMsIENBUF9SRUFELCBDQVBfRlNUQVQpKTsNCj4gKwkgICAgY2FwX3JpZ2h0 c19pbml0KCZyaWdodHMsIENBUF9SRUFELCBDQVBfRlNUQVQpLCBGQV9PUEVOKTsNCj4gIAlpZiAo ZmEgPT0gTlVMTCkgew0KPiAgCQl4b193YXJuKCJVbmFibGUgdG8gaW5pdCBjYXNwZXIiKTsNCj4g IAkJZXhpdCgxKTsNCj4gX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX18NCj4gc3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnIG1haWxpbmcgbGlzdA0KPiBodHRwczov L2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4vbGlzdGluZm8vc3ZuLXNyYy1oZWFkDQo+IFRvIHVu c3Vic2NyaWJlLCBzZW5kIGFueSBtYWlsIHRvICJzdm4tc3JjLWhlYWQtdW5zdWJzY3JpYmVAZnJl ZWJzZC5vcmciDQoNClRoaXMgY29tbWl0IHNlZW1zIHRvIGJyZWFrIGJ1aWxkd29ybGQgb24gbXkg aW5zdGFsbGF0aW9uczoNCg0KWy4uLl0NCkJ1aWxkaW5nIC91c3Ivb2JqL3Vzci9zcmMvYW1kNjQu YW1kNjQvdG1wL29iai10b29scy91c3IuYmluL3N0cmluZ3Mvc3RyaW5ncy5vDQotIC0tLSBzdHJp bmdzLm8gLS0tDQovdXNyL3NyYy9jb250cmliL2VsZnRvb2xjaGFpbi9zdHJpbmdzL3N0cmluZ3Mu YzoxOTg6NTU6IGVycm9yOiB1c2Ugb2YgdW5kZWNsYXJlZCBpZGVudGlmaWVyDQonRkFfT1BFTicg ZmEgPSBmaWxlYXJnc19pbml0KGFyZ2MsIGFyZ3YsIE9fUkRPTkxZLCAwLCAmcmlnaHRzLCBGQV9P UEVOKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBeDQoxIGVycm9yIGdlbmVyYXRlZC4NCioqKiBbc3RyaW5ncy5vXSBFcnJvciBj b2RlIDENCg0KDQpLaW5kIHJlZ2FyZHMsDQoNCk8uIEhhcnRtYW5uDQoNCi0gLS0gDQpPLiBIYXJ0 bWFubg0KDQpJY2ggd2lkZXJzcHJlY2hlIGRlciBOdXR6dW5nIG9kZXIgw5xiZXJtaXR0bHVuZyBt ZWluZXIgRGF0ZW4gZsO8cg0KV2VyYmV6d2Vja2Ugb2RlciBmw7xyIGRpZSBNYXJrdC0gb2RlciBN ZWludW5nc2ZvcnNjaHVuZyAowqcgMjggQWJzLiA0IEJEU0cpLg0KLS0tLS1CRUdJTiBQR1AgU0lH TkFUVVJFLS0tLS0NCg0KaUhVRUFSWUlBQjBXSVFTeThJQnhBUERrcVZCYVRKNDROMVpaUGJhNVJ3 VUNYTGRuc1FBS0NSQTROMVpaUGJhNQ0KUjJIU0FQNGtlU1N5UEwva0ZMZkpGWUlnYVNTUzN4Y0NX NnRIanUyVE0rNTA4c1pRbUFFQXYzSHlVVHlibGE3ZA0KdjhpeHBicGhROVAwb09NaFBUZHFHcWhz aWVBbk93Yz0NCj1hK1l0DQotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-head@freebsd.org Wed Apr 17 18:05:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4331415748EA; Wed, 17 Apr 2019 18:05:47 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id D71CC8BC9E; Wed, 17 Apr 2019 18:05:46 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [192.168.1.41] (89.red-88-7-96.staticip.rima-tde.net [88.7.96.89]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 396234E632; Wed, 17 Apr 2019 18:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1555524344; bh=+e45QVdIYJQk78d4l3r/wtPRw+D60e9/T/mEz6VvwCM=; h=From:Subject:Date:In-Reply-To:Cc:To:References; b=sK5SrVgQJU1b0U0dmZntYzlr8LtrpFxasRRRZoh+MhBVSg6U6ENw5fpWvm4IDDPjM wwKuq9+tfBs+ZD3MZ63nJtwLQ0cW9vcsIxWNWOnrHQNZr7PsmXHyc5Erg9UtK2CRln 6YShPWTUcC2xVcp92wZY8oZSuotSd6kmjrS1yoQQmfQaV7bh0TX8ObMJ69ZmVsFv06 J5xLkBnzv3elqSsb29VphEELcL91hkLxKZB71f5mA7kctpPM6i8zdLH3onAch2Q4VN mvnwmO1zfsCZ6zVlXpmcFxn6HR+bRYZkZgh6t59InJrNcb3QiAgmuVvOa0fWQEOgbd +yzDu0xmpb+aX6CT1a+qhQYLpeqg9CYGg6PeDQE62TmSXZZ8MJpQFHwRZ5zBYu1cOT qVDrS7i9xDPqEiGosqMC7FtIEUTLVdQFbRqp0RBtJulZM6AFIEXa/ftrL3KmkSOWXI yHRlLyMErZe7FPWDPEH/SwxDtWUPGYC3kGf/mp/t+5VKdN6j2W7G98jMheEYcZz95y +36rUheNzGTnVAjceb0J/2JKoDtZFr3sea/HzppH/gal/HZ859KGi0qRvfj4z1bnvq Q7VA306myOxS843WNE/qexf9EszpZlF3pAfuBlHPjw/nyNQyWksJpz29OOS25Ww5g6 xqTT8f4+4ujiotjXC+dPZcJ0= From: Andrew Turner Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346295 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124 a... Date: Wed, 17 Apr 2019 20:05:43 +0200 In-Reply-To: Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Ian Lepore References: <201904162004.x3GK4N7u019636@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: D71CC8BC9E 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.989,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Wed, 17 Apr 2019 18:05:47 -0000 > On 17 Apr 2019, at 17:52, Ian Lepore wrote: >=20 > On Wed, 2019-04-17 at 11:23 +0200, Andrew Turner wrote: >>> On 16 Apr 2019, at 22:04, Emmanuel Vadot wrote: >>>=20 >>> Author: manu >>> Date: Tue Apr 16 20:04:22 2019 >>> New Revision: 346295 >>> URL: https://svnweb.freebsd.org/changeset/base/346295 >>>=20 >>> Log: >>> arm: Add kern_clocksource.c directly in files.arm >>>=20 >>> This files is needed and included in all our config so move it to >>> a common >>> location. >>>=20 >>> MFC after: 2 weeks >>=20 >> ... >>> Modified: head/sys/conf/files.arm >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- head/sys/conf/files.arm Tue Apr 16 19:46:02 2019 = (r346294) >>> +++ head/sys/conf/files.arm Tue Apr 16 20:04:22 2019 = (r346295) >>> @@ -11,6 +11,9 @@ cloudabi32_vdso_blob.o optional = com >>> pat_cloudabi32 \ >>> no-implicit-rule = \ >>> clean "cloudabi32_vdso_blob.o" >>> # >>> + >>> +kern/kern_clocksource.c standard >>=20 >> Could this be moved from the various files.* to files? It seems we >> define it as standard on all architectures. >>=20 >>=20 >=20 > I thought mips still had some variants that didn't implement event > timers. That's why this stuff was ever in arch-specific files, arm = and > mips had some flavors without ET support. I think it used to be the case on arm. A grep seems to think it=E2=80=99s = enabled on all architectures now: grep kern_clocksource files.* files.amd64:kern/kern_clocksource.c standard files.arm:kern/kern_clocksource.c standard files.arm64:kern/kern_clocksource.c standard files.i386:kern/kern_clocksource.c standard files.mips:kern/kern_clocksource.c standard files.powerpc:kern/kern_clocksource.c standard files.riscv:kern/kern_clocksource.c standard files.sparc64:kern/kern_clocksource.c standard Andrew From owner-svn-src-head@freebsd.org Wed Apr 17 18:08:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C941574A52; Wed, 17 Apr 2019 18:08:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C18FE8BEA2; Wed, 17 Apr 2019 18:08:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f48.google.com with SMTP id p16so21406174iod.2; Wed, 17 Apr 2019 11:08:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=25UmBtc9HFlYLIS8E/28Z8IXOIrF2VTG7EPUUutq/6Q=; b=JY3DMcAQxGYrBxVd6RhZNYEFu01ETwIpp8DFkg2/djEzvUkBS04TF5iyy5ov9qek2w OYLMt4lgmDmAk4wKDduse5g2W5f87As77LSrNCXDqIeloVcFZdsLgdhycoRkshZLdENe 4WTsvo6twYvQgrhXEQgqZ5G4QVxE3nqcuMmXXJYq85WMNtCV93bMnmUyp9tIaNHnb9f0 tXrJ88RY6mGUYuKTMMXj+LM4Tv7WAfTCF2nX9gtBhDVElPwUGroqAJTl48AhtXkZeNOo US4FsVG+DllVwVunjXAMoTehfDUOoWhg4SDGliJl7Ke22fc/Bc26sKCRMLBwgeiJirMP IvSA== X-Gm-Message-State: APjAAAX1rnTHlit4e9qwWXnu3OBtnBXW5zksdyeJPPueQyQNpRXDaEld 097fboacd/KRxHT3s60+5pioPjmm X-Google-Smtp-Source: APXvYqzUuEtB2fD8OpXjCrZsyO15AMev9y3xEwFJ/F3NUZaLEVICbtEdNNmiwBDGOq6DQI1qXDOHHg== X-Received: by 2002:a5e:d510:: with SMTP id e16mr773614iom.297.1555524021294; Wed, 17 Apr 2019 11:00:21 -0700 (PDT) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com. [209.85.166.179]) by smtp.gmail.com with ESMTPSA id v23sm20398139ioq.6.2019.04.17.11.00.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 11:00:21 -0700 (PDT) Received: by mail-it1-f179.google.com with SMTP id 139so5846283ita.4; Wed, 17 Apr 2019 11:00:21 -0700 (PDT) X-Received: by 2002:a05:6638:28c:: with SMTP id c12mr33927696jaq.87.1555524020968; Wed, 17 Apr 2019 11:00:20 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> <457a2c63-f062-8fc6-15d4-6f5b93981930@FreeBSD.org> <5d790a56-1498-094e-6bb4-48345a231e55@FreeBSD.org> <383a21de-9a7a-2d06-1673-001e84af67f9@FreeBSD.org> In-Reply-To: <383a21de-9a7a-2d06-1673-001e84af67f9@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 17 Apr 2019 11:00:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C18FE8BEA2 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.987,0]; TAGGED_FROM(0.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: Wed, 17 Apr 2019 18:08:22 -0000 Hi John, On Wed, Apr 17, 2019 at 9:01 AM John Baldwin wrote: > You're missing the point which is that you've added potential blocking in a lot of > places by changing the semantics of arc4random. I get it. The thing is, it's a weird blocking semantic. It's not the same as any other blocking semantic we have elsewhere in the kernel. It can't happen in any particular call. Once it unblocks, it's nonblocking forever after. So if the caller a priori knows that random is seeded, it's not a blocking operation. > Unless you're intending to > hand-audit all of them (as well as future uses), I think having the existing > API be "safe" (and blocking) but use WITNESS_WARN is a way to catch existing > and future locking problems. This would essentially just force auditing, no? I guess it helps highlight instances that are (a) actually inside a locked region and (b) run by users. I'm on board with this approach. My only concern is that we will have false positives (and continue to have false positives after true positives are made safe). One thing we could do is teach WITNESS about random's seeded/not status. Let's take away: I'll owe you a differential implementing some version of this proposal, as well as a separate one for the giant unsafe-random knob, and we can discuss the technical details offline. Expect something today, if at all possible. > The EWOULDBLOCK API is something a developer > would choose and it means they would be aware of the constraint and need to > deal with it, either by handling EWOULDBLOCK in some way, or deferring use > until seeded, etc. Ok; if it is attached to a specific need, and it has '__attribute__((warn_unused_result))' attached to it, I'm tentatively ok with the idea. I don't want to add additional interfaces that don't get used, or make it easy to accidentally get non-results. Best regards, Conrad From owner-svn-src-head@freebsd.org Wed Apr 17 18:08:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18E321574A9E; Wed, 17 Apr 2019 18:08:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 AF7CA8BF71; Wed, 17 Apr 2019 18:08:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9468AC3A; Wed, 17 Apr 2019 18:08:28 +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 x3HI8ShW017243; Wed, 17 Apr 2019 18:08:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HI8SCX017242; Wed, 17 Apr 2019 18:08:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904171808.x3HI8SCX017242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 17 Apr 2019 18:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346328 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 346328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF7CA8BF71 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.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 18:08:33 -0000 Author: kevans Date: Wed Apr 17 18:08:28 2019 New Revision: 346328 URL: https://svnweb.freebsd.org/changeset/base/346328 Log: Compile sha1.c when ether support is included sha1 is used by ether_gen_addr after r346324. Perhaps in an ideal world we could detect that the kernel's been compiled without sha1_* bits included and silently fallback to arc4random instead because these platforms/kernel configs are far and few between. It's fairly lightweight, though, so just include it for now. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 17 17:50:44 2019 (r346327) +++ head/sys/conf/files Wed Apr 17 18:08:28 2019 (r346328) @@ -680,8 +680,8 @@ crypto/rijndael/rijndael-alg-fst.c optional crypto | e crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | random !random_loadable crypto/rijndael/rijndael-api.c optional crypto | ipsec | ipsec_support | \ wlan_ccmp -crypto/sha1.c optional carp | crypto | ipsec | \ - ipsec_support | netgraph_mppc_encryption | sctp +crypto/sha1.c optional carp | crypto | ether | ipsec | \ + ipsec_support | netgraph_mppc_encryption | sctp crypto/sha2/sha256c.c optional crypto | ekcd | geom_bde | ipsec | \ ipsec_support | random !random_loadable | sctp | zfs crypto/sha2/sha512c.c optional crypto | geom_bde | ipsec | \ From owner-svn-src-head@freebsd.org Wed Apr 17 18:22:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A19AA157521E; Wed, 17 Apr 2019 18:22:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 804E28CA57; Wed, 17 Apr 2019 18:22:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wr1-x429.google.com with SMTP id s15so33170004wra.12; Wed, 17 Apr 2019 11:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PJ9kbcJCtaQ5smMbT6vrY8BlH/XWFuYJIzSHDIcU5xw=; b=H28mYt2AwRoBOoVgdjJQ3k56s8ADu+7G8KTrECZpSWJBJbDr71C+OK7iKM4PN4rPzV 6uBzuIGCeSm9D2LcTZNFathL7LeV5VQWKAZ1oTUnbTWCk+N1F7qvMGG1UPR1DrplXI0N +j1WqkRiwNwZK3hnw9czq/oxFBcxfZSY65pEb2neA04jOarkNuwCFUYwf423VaD5RER2 X/D8yMuiIUDvGBgkBiJMFelsf2BHesTlU9hT9jAZFGq60om9GxnYtqfKZJhAwsoSPzcB qZodfvgFovwmD+MH7TFRnSvziWD8U3tIIuo9VBYyUohP+Cxr05mqgPme1JBucciT6JbU lmOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PJ9kbcJCtaQ5smMbT6vrY8BlH/XWFuYJIzSHDIcU5xw=; b=eSUiaw9qZiPuOmk76RYQN3TYvQ8idip/35EOIhM9dgthOyNwEnkEWAHqotEgwrZwrd t6Lv8glC/+0mG5Cj4kOuUKWUse4sjPU+I6tEVZDXqKvmOuIDZ9B/kAM0d8GmwERMoq5d v4JaKWiWnqRmPeAmcz9XyrNGHnveg1wxQ3z1HVk7lo+c9UMVBqDoQSRNMjhoyHaPQ7Oe rBgmDqRIwXYzPIlf2VdFnjRRCsnaFxliZeDCdd5zOCzT3E/eGCt1hSk2SsdMW7xZmUPu mWJPDpGr+xhV4XG/8tBxdTmLkiT17JrOjxl0dQw87KlH3kI0vStPX5UN+okH4ok1iQBJ CofA== X-Gm-Message-State: APjAAAV3/GrGLY6ysfSgw+xtwOSq77yjUCeGJsxJ5Xzuv5M0Zpa4MVpg oDNNlaFI/ORX/qBxfOxTVTvsC5XC2wikAMXIgpgR5A== X-Google-Smtp-Source: APXvYqyn5HQQ4H2MYjJP67VEKEuDfCZvPy7X0nABbsW+NzIfNhHl3LU7SCRrbpRBCFXsBBQYaM6ANLMHG/nm3XkmdgA= X-Received: by 2002:adf:c788:: with SMTP id l8mr57231269wrg.143.1555525362747; Wed, 17 Apr 2019 11:22:42 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> In-Reply-To: <201904151840.x3FIeaEQ009242@repo.freebsd.org> From: Adrian Chadd Date: Wed, 17 Apr 2019 11:22:29 -0700 Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 804E28CA57 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=H28mYt2A; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2a00:1450:4864:20::429 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-6.73 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[9.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.77)[ip: (-9.19), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-2.22), country: US(-0.06)]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Wed, 17 Apr 2019 18:22:46 -0000 On Mon, 15 Apr 2019 at 11:40, Conrad Meyer wrote: > Author: cem > Date: Mon Apr 15 18:40:36 2019 > New Revision: 346250 > URL: https://svnweb.freebsd.org/changeset/base/346250 > > Log: > random(4): Block read_random(9) on initial seeding > Sniffle, this broke on my mips boards whilst debugging why I'm seeing transmit crashes and other bad behaviours. if_arge has some hacks to randomly allocate mac addresses if the board doesn't supply them. This is going to be a common thing to deal with during board bring-up before you do things like, I dunno, make storage work. I'm going to fix if_arge to use the new API to generate MAC addresses but there'll be other places where this will bite you. Please reconsider this a bit. I know people are trying to improve our security and cryptography support. But some of us are trying to use FreeBSD code in fun places and maybe occasionally do some more porting work. :-) -adrian From owner-svn-src-head@freebsd.org Wed Apr 17 18:27:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB55B157549B; Wed, 17 Apr 2019 18:27:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com [209.85.166.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8740E8CD65; Wed, 17 Apr 2019 18:27:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f174.google.com with SMTP id f22so6004064ita.3; Wed, 17 Apr 2019 11:27:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=QGP7F9m4o/RsepS72FdozeGpLOMdlnr2ofMC6Id59e0=; b=hScPq0cAcamBmRJAMP1xO+MK3Y8ZyXXRC9pG9fg0oxVdsusWUI5qAlzNCoTpinX0AU QDcxwFH+hKPN7G5IOl12rhsA23JasLZDygR6nrbWOZwVvXu+ilKZBvi5VI5ZEgqleAZd JBwDyhzP70ZB5oRH5VdHS4NZrE+69oJYklXXp7NKdul31N2mJfR4aJs00830q6CeTD7j X7/sL39XtmzzHEXgewjVVqSre2STsy57INngrh8rwvKMEL4kTMBMMkUEtwrG7H6nxsyi W1blp4MzgfKPgk2W6iG6ShCAe6Hf/MeOWXFSlGZk1JSjQcqd/r8JCWSdKa4LzRNKp3ik Y5Cw== X-Gm-Message-State: APjAAAUmuhPual2i3PESQkp1V7ImIZfnZDkl1Y86yH27i7pp5QY5mtqZ lpZptnTzB1QTWVKV0BBahvilk1Ng X-Google-Smtp-Source: APXvYqwG41FXn6IodcrGBQ9SjFT6gInOvxDQOGinCZkeci/8WW3J0ZaTVquDJUyYV44X9cZ9+YTRpA== X-Received: by 2002:a05:6638:26e:: with SMTP id x14mr821880jaq.32.1555525662447; Wed, 17 Apr 2019 11:27:42 -0700 (PDT) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com. [209.85.166.53]) by smtp.gmail.com with ESMTPSA id s10sm20547337ioc.54.2019.04.17.11.27.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 11:27:42 -0700 (PDT) Received: by mail-io1-f53.google.com with SMTP id s7so2194668iom.12; Wed, 17 Apr 2019 11:27:42 -0700 (PDT) X-Received: by 2002:a6b:c84e:: with SMTP id y75mr40997792iof.107.1555525661861; Wed, 17 Apr 2019 11:27:41 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 17 Apr 2019 11:27:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys To: Adrian Chadd Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 8740E8CD65 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.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Wed, 17 Apr 2019 18:27:49 -0000 Hey Adrian, As discussed with John and Warner upthread, I hope to have a patch out for review later today to give folks a knob to disable this. It may even make sense to default it on, at least for !x86. I am happy to CC you on review if you like. Take care, Conrad On Wed, Apr 17, 2019 at 11:22 AM Adrian Chadd wrot= e: > > > > On Mon, 15 Apr 2019 at 11:40, Conrad Meyer wrote: >> >> Author: cem >> Date: Mon Apr 15 18:40:36 2019 >> New Revision: 346250 >> URL: https://svnweb.freebsd.org/changeset/base/346250 >> >> Log: >> random(4): Block read_random(9) on initial seeding > > > Sniffle, this broke on my mips boards whilst debugging why I'm seeing tra= nsmit crashes and other bad behaviours. if_arge has some hacks to randomly = allocate mac addresses if the board doesn't supply them. This is going to b= e a common thing to deal with during board bring-up before you do things li= ke, I dunno, make storage work. I'm going to fix if_arge to use the new API= to generate MAC addresses but there'll be other places where this will bit= e you. > > Please reconsider this a bit. I know people are trying to improve our sec= urity and cryptography support. But some of us are trying to use FreeBSD co= de in fun places and maybe occasionally do some more porting work. :-) > > > -adrian > > From owner-svn-src-head@freebsd.org Wed Apr 17 19:16:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25D2A1576646; Wed, 17 Apr 2019 19:16:27 +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 BDEBB8F284; Wed, 17 Apr 2019 19:16:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1DEEB857; Wed, 17 Apr 2019 19:16:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HJGQLM055935; Wed, 17 Apr 2019 19:16:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HJGQvl055934; Wed, 17 Apr 2019 19:16:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171916.x3HJGQvl055934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 19:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346329 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDEBB8F284 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)[-1.000,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: Wed, 17 Apr 2019 19:16:27 -0000 Author: emaste Date: Wed Apr 17 19:16:26 2019 New Revision: 346329 URL: https://svnweb.freebsd.org/changeset/base/346329 Log: Install some entropy for QEMU CI smoke test See r346250 and followup commits and mailing list discussion. We currently fail to boot properly in the absense of boot-time entropy. Sponsored by: The FreeBSD Foundation Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Wed Apr 17 18:08:28 2019 (r346328) +++ head/tools/boot/ci-qemu-test.sh Wed Apr 17 19:16:26 2019 (r346329) @@ -68,6 +68,9 @@ echo "Hello world." /sbin/shutdown -p now EOF + # Entropy needed to boot, see r346250 and followup commits/discussion. + dd if=/dev/random of=${ROOTDIR}/boot/entropy bs=4k count=1 + # Remove unnecessary files to keep FAT filesystem size down. rm -rf ${ROOTDIR}/METALOG ${ROOTDIR}/usr/lib } From owner-svn-src-head@freebsd.org Wed Apr 17 19:24:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3601D1576A4E; Wed, 17 Apr 2019 19:24:42 +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 C752E8F874; Wed, 17 Apr 2019 19:24:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B699FBA2F; Wed, 17 Apr 2019 19:24:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HJOfwP061078; Wed, 17 Apr 2019 19:24:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HJOfiX061077; Wed, 17 Apr 2019 19:24:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904171924.x3HJOfiX061077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 17 Apr 2019 19:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346330 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C752E8F874 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)[-1.000,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: Wed, 17 Apr 2019 19:24:42 -0000 Author: emaste Date: Wed Apr 17 19:24:41 2019 New Revision: 346330 URL: https://svnweb.freebsd.org/changeset/base/346330 Log: Put QEMU CI smoke test boot log in /tmp if TMPDIR not set Sponsored by: The FreeBSD Foundation Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Wed Apr 17 19:16:26 2019 (r346329) +++ head/tools/boot/ci-qemu-test.sh Wed Apr 17 19:24:41 2019 (r346330) @@ -95,7 +95,7 @@ trap tempdir_cleanup EXIT SIGINT SIGHUP SIGTERM SIGQUI ( cd ${SRCTOP} && tempdir_setup ) # And, boot in QEMU. -: ${BOOTLOG:=${TMPDIR}/ci-qemu-test-boot.log} +: ${BOOTLOG:=${TMPDIR:-/tmp}/ci-qemu-test-boot.log} timeout 300 \ qemu-system-x86_64 -m 256M -bios ${OVMF} \ -serial stdio -vga none -nographic -monitor none \ From owner-svn-src-head@freebsd.org Wed Apr 17 19:42:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 729911576F07; Wed, 17 Apr 2019 19:42:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D2FA79008B; Wed, 17 Apr 2019 19:42:19 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id GqRchT3XZldkPGqRdh8alz; Wed, 17 Apr 2019 13:42:11 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=8nJEP1OIZ-IA:10 a=oexKYjalfGEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=I6yUJlocKgAmpqPFSQ4A:9 a=ujYVat4fVGMNhHHV:21 a=wPNLvfGTeEIA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 0D1C19FB; Wed, 17 Apr 2019 12:42:08 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x3HJfmxa090934; Wed, 17 Apr 2019 12:41:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x3HJfmee090931; Wed, 17 Apr 2019 12:41:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201904171941.x3HJfmee090931@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "O. Hartmann" cc: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc In-Reply-To: Message from "O. Hartmann" of "Wed, 17 Apr 2019 19:51:18 +0200." <20190417195145.6824c0f9@thor.intern.walstatt.dynvpn.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 17 Apr 2019 12:41:48 -0700 X-CMAE-Envelope: MS4wfH9c/N9rJwfMu4tAy3Z3R51gre7O2Kot8t853ldJkEMc6j6ngYkCuHjsPRopGQSVxqb6QmTB1Sql4CMfrGHt0yhZJNJ2geEsDD60mFBZdcRnDuJOE9cz Hiq3+xRjiA5r38OwyTCSzVerccyWodG38mlchq+Opo/RoLAKbSMOHw63k5ZsU+zhL0YvBwmLVpvyVvuV2CshN4ET5AzE2BV6pP8vxF+hqQc35cNUftB/BlUb 42LAYWzBIy32Z8L0krAtXhpwtOGvnSwYCyhWU2y6Yp1jvMe3azA7/s8SP/+A/FccHvBK797U0Hl2a1BX8NSokMZio1yAzkeRy2YCTRLkx3k= X-Rspamd-Queue-Id: D2FA79008B X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.16 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-2.52)[ip: (-6.93), ipnet: 64.59.128.0/20(-3.16), asn: 6327(-2.41), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1] 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, 17 Apr 2019 19:42:22 -0000 In message <20190417195145.6824c0f9@thor.intern.walstatt.dynvpn.de>, "O. Hartma nn" writes: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Am Wed, 17 Apr 2019 16:18:14 +0000 (UTC) > Ed Maste schrieb: > > > Author: emaste > > Date: Wed Apr 17 16:18:14 2019 > > New Revision: 346316 > > URL: https://svnweb.freebsd.org/changeset/base/346316 > > > > Log: > > cap_fileargs: chase r346315, update fileargs_init in consumers > > > > Reported by: ci.freebsd.org (8 times so far) > > MFC after: 3 weeks > > MFC with: r346315 > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/contrib/elftoolchain/strings/strings.c > > head/sbin/savecore/savecore.c > > head/usr.bin/brandelf/brandelf.c > > head/usr.bin/head/head.c > > head/usr.bin/wc/wc.c > > > > Modified: head/contrib/elftoolchain/strings/strings.c > > =========================================================================== > === > > --- head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:02:57 201 > 9 > > (r346315) +++ head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:1 > 8:14 > > 2019 (r346316) @@ -195,7 +195,7 @@ main(int argc, char **argv) > > argv += optind; > > > > cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL); > > - fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights); > > + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > if (fa == NULL) > > err(1, "Unable to initialize casper fileargs"); > > > > > > Modified: head/sbin/savecore/savecore.c > > =========================================================================== > === > > --- head/sbin/savecore/savecore.c Wed Apr 17 16:02:57 2019 (r34631 > 5) > > +++ head/sbin/savecore/savecore.c Wed Apr 17 16:18:14 2019 (r34631 > 6) > > @@ -1030,7 +1030,7 @@ init_caps(int argc, char **argv) > > */ > > (void)cap_rights_init(&rights, CAP_PREAD, CAP_WRITE, CAP_IOCTL); > > capfa = fileargs_init(argc, argv, checkfor || keep ? O_RDONLY : O_RDWR, > > - 0, &rights); > > + 0, &rights, FA_OPEN); > > if (capfa == NULL) { > > logmsg(LOG_ERR, "fileargs_init(): %m"); > > exit(1); > > > > Modified: head/usr.bin/brandelf/brandelf.c > > =========================================================================== > === > > --- head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:02:57 2019 > (r346315) > > +++ head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:18:14 2019 > (r346316) > > @@ -133,7 +133,7 @@ main(int argc, char **argv) > > if (flags == O_RDWR) > > cap_rights_set(&rights, CAP_WRITE); > > > > - fa = fileargs_init(argc, argv, flags, 0, &rights); > > + fa = fileargs_init(argc, argv, flags, 0, &rights, FA_OPEN); > > if (fa == NULL) > > errx(1, "unable to init casper"); > > > > > > Modified: head/usr.bin/head/head.c > > =========================================================================== > === > > --- head/usr.bin/head/head.c Wed Apr 17 16:02:57 2019 (r34631 > 5) > > +++ head/usr.bin/head/head.c Wed Apr 17 16:18:14 2019 (r34631 > 6) > > @@ -115,7 +115,7 @@ main(int argc, char *argv[]) > > argv += optind; > > > > fa = fileargs_init(argc, argv, O_RDONLY, 0, > > - cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL)); > > + cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL), FA_OPEN); > > if (fa == NULL) > > errx(1, "unable to init casper"); > > > > > > Modified: head/usr.bin/wc/wc.c > > =========================================================================== > === > > --- head/usr.bin/wc/wc.c Wed Apr 17 16:02:57 2019 (r346315) > > +++ head/usr.bin/wc/wc.c Wed Apr 17 16:18:14 2019 (r346316) > > @@ -133,7 +133,7 @@ main(int argc, char *argv[]) > > (void)signal(SIGINFO, siginfo_handler); > > > > fa = fileargs_init(argc, argv, O_RDONLY, 0, > > - cap_rights_init(&rights, CAP_READ, CAP_FSTAT)); > > + cap_rights_init(&rights, CAP_READ, CAP_FSTAT), FA_OPEN); > > if (fa == NULL) { > > xo_warn("Unable to init casper"); > > exit(1); > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > This commit seems to break buildworld on my installations: > > [...] > Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/strings/strings.o > - --- strings.o --- > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of undecla > red identifier > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > ^ > 1 error generated. > *** [strings.o] Error code 1 Try this. We shouldn't use headers in /usr/include, only the ones in src/. Index: tools/build/Makefile =================================================================== --- tools/build/Makefile (revision 346330) +++ tools/build/Makefile (working copy) @@ -59,9 +59,7 @@ INCS+= libcasper.h .endif -.if !exists(/usr/include/casper/cap_fileargs.h) CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs. h -.endif .if empty(SRCS) SRCS= dummy.c I found a number of bugs like this one in heimdal in base and in ntp previously. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Apr 17 20:00:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 506BA1577A1E for ; Wed, 17 Apr 2019 20:00:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7329690B05 for ; Wed, 17 Apr 2019 20:00:09 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f175.google.com with SMTP id q14so6845792itk.0 for ; Wed, 17 Apr 2019 13:00:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:cc; bh=oliKEeX5LVs4UAtoKJXGziii1cXIejgiXKULEHpqBr4=; b=CZXe5umvBv32XM2mwIB0hGHAM88K+vMFvKR+3VpmqKFBFaoqBGcVmQqsO4v+Q9/G+H jUA6prN9MSZivLVnPCghM11A37L44EenP6CXcsVh35x3uY44cbwyAcN20y3a5mwQfjAR I7qKEqc5HrYF/C5soO1fa1NBx2KtnuAjsQb/QvNOLQZJNQqEzkeCVEWCoLm6f8p7exGa RSfE2XcXbvTH+MERiWCzC7gKyyMDj8DjtvLekQ1tQCSRDiMtoGsywCVF94QRV6TLZtuB 7H1WfxFCBg52Kcgj9hycimUFipUQw13PyI0JtDDgPdKSPKoFDnEONWNvshkamfQ6eqMw 2yuw== X-Gm-Message-State: APjAAAUxCNeulDnS3FKdWPLbeZaQnhi6zkFV51uErvDtCGHWSyenaKOh spZzbi2ZUcwdDuVWchLuzzHPpBiG X-Google-Smtp-Source: APXvYqyFpQwBQfSt5ahJnD9NsIyKpmTFXEUhw9ru3FXcupeS8fe+vIZH62PetovPcj3FlI6YvcGCdA== X-Received: by 2002:a02:c843:: with SMTP id r3mr62759184jao.12.1555531202690; Wed, 17 Apr 2019 13:00:02 -0700 (PDT) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com. [209.85.166.174]) by smtp.gmail.com with ESMTPSA id w184sm1792108ita.9.2019.04.17.13.00.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 13:00:02 -0700 (PDT) Received: by mail-it1-f174.google.com with SMTP id w15so6454435itc.0 for ; Wed, 17 Apr 2019 13:00:02 -0700 (PDT) X-Received: by 2002:a05:660c:10:: with SMTP id q16mt296716itj.149.1555531202079; Wed, 17 Apr 2019 13:00:02 -0700 (PDT) MIME-Version: 1.0 References: <201904151840.x3FIeaEQ009242@repo.freebsd.org> In-Reply-To: <201904151840.x3FIeaEQ009242@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 17 Apr 2019 12:59:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346250 - in head: share/man/man4 share/man/man9 sys/dev/random sys/kern sys/libkern sys/sys Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7329690B05 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.175 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-3.45 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; MISSING_TO(2.00)[]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; IP_SCORE(-2.47)[ip: (-6.20), ipnet: 209.85.128.0/17(-3.88), asn: 15169(-2.22), country: US(-0.06)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[175.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.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: Wed, 17 Apr 2019 20:00:10 -0000 On Mon, Apr 15, 2019 at 11:40 AM Conrad Meyer wrote: > > Author: cem > Date: Mon Apr 15 18:40:36 2019 > New Revision: 346250 > URL: https://svnweb.freebsd.org/changeset/base/346250 > > Log: > random(4): Block read_random(9) on initial seeding Hi, For anyone interested in a change to restore the previous behavior (optionally, but on by default for now), please see https://reviews.freebsd.org/D19944 . Thanks, Conrad From owner-svn-src-head@freebsd.org Wed Apr 17 20:09:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B1A31577E8C; Wed, 17 Apr 2019 20:09:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 01F2E9126F; Wed, 17 Apr 2019 20:09:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9672C2B9; Wed, 17 Apr 2019 20:09:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HK92ZU082288; Wed, 17 Apr 2019 20:09:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HK91Sa082284; Wed, 17 Apr 2019 20:09:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904172009.x3HK91Sa082284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Apr 2019 20:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346332 - in head: share/man/man9 sys/conf sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/dev/ofw X-SVN-Commit-Revision: 346332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01F2E9126F 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.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 17 Apr 2019 20:09:03 -0000 Author: manu Date: Wed Apr 17 20:09:01 2019 New Revision: 346332 URL: https://svnweb.freebsd.org/changeset/base/346332 Log: ofw_graph: Add functions for graph bindings Those functions are helpers to work on graph bindings. graphs are mostly use with video related devices. See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/graph.txt?id=4436a3711e3249840e0679e92d3c951bcaf25515 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19877 Added: head/share/man/man9/ofw_graph.9 (contents, props changed) head/sys/dev/ofw/ofw_graph.c (contents, props changed) head/sys/dev/ofw/ofw_graph.h (contents, props changed) Modified: head/sys/conf/files Added: head/share/man/man9/ofw_graph.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/ofw_graph.9 Wed Apr 17 20:09:01 2019 (r346332) @@ -0,0 +1,106 @@ +.\" Copyright (c) 2019 Emmanuel Vadot +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS 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 April 10, 2019 +.Dt ofw_graph 9 +.Os +.Sh NAME +.Nm ofw_graph , +.Nm ofw_graph_get_port_by_idx , +.Nm ofw_graph_port_get_num_endpoints , +.Nm ofw_graph_get_endpoint_by_idx , +.Nm ofw_graph_get_remote_endpoint , +.Nm ofw_graph_get_remote_parent , +.Nm ofw_graph_get_device_by_port_ep , +.Nd Helpers for the graph bindings +.Sh SYNOPSIS +.In dev/ofw/openfirm.h +.In dev/ofw/ofw_graph.h +.Ft phandle_t +.Fn ofw_graph_get_port_by_idx "phandle_t node" "uint32_t idx" +.Ft size_t +.Fn ofw_graph_port_get_num_endpoints "phandle_t port" +.Ft phandle_t +.Fn ofw_graph_get_endpoint_by_idx "phandle_t port" "uint32_t idx" +.Ft phandle_t +.Fn ofw_graph_get_remote_endpoint "phandle_t endpoint" +.Ft phandle_t +.Fn ofw_graph_get_remote_parent "phandle_t remote" +.Ft device_t +.Fn ofw_graph_get_device_by_port_ep "phandle_t node" "uint32_t port_id" "uin32_t ep_id" +.Sh DESCRIPTION +.Pp +The ofw_graph functions are helpers to parse the DTS graph bindings +.Pp +.Fn ofw_graph_get_port_by_idx +return the port with id +.Fa idx . +It will first check node named +.Fa port@idx +and then fallback on checking the +.Fa ports +child for a child node matching the id. If no ports matching +.Fa idx +is found the function return 0. +.Pp +.Fn ofw_graph_port_get_num_endpoints +returns the number of endpoints a port node have. +.Pp +.Fn ofw_graph_get_endpoint_by_idx +return the endpoint with id +.Fa idx . +It will first check if there is a single child named +.Fa endpoint +and returns it if there is. If there is multiple endpoints it will check +the +.Fa reg +property and returns the correct +.Fa phandle_t +or 0 if none match. +.Pp +.Fn ofw_graph_get_remote_endpoint +returns the +.Fa remote-endpoint +property if it exists or 0. +.Pp +.Fn ofw_graph_get_remote_parent +returns the device node corresponding to the +.Fa remote-endpoint +phandle or 0 if none. +.Fn ofw_graph_get_device_by_port_ep +returns the device associated with the port and endpoint or +.Fa NULL +if none. The device driver should have called +.Fn OF_device_register_xref +before. +.Fn +.Sh HISTORY +The +.Nm ofw_graph +functions first appeared in +.Fx 13.0 . +The +.Nm ofw_graph +functions and manual page were written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 17 20:08:01 2019 (r346331) +++ head/sys/conf/files Wed Apr 17 20:09:01 2019 (r346332) @@ -2536,6 +2536,7 @@ dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt +dev/ofw/ofw_graph.c optional fdt dev/ofw/ofw_subr.c optional fdt dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt Added: head/sys/dev/ofw/ofw_graph.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_graph.c Wed Apr 17 20:09:01 2019 (r346332) @@ -0,0 +1,186 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "ofw_bus_if.h" + +#define PORT_MAX_NAME 8 + +phandle_t +ofw_graph_get_port_by_idx(phandle_t node, uint32_t idx) +{ + phandle_t ports, child; + uint32_t reg; + char portnode[PORT_MAX_NAME]; + + /* First try to find a port@ node */ + snprintf(portnode, sizeof(portnode), "port@%d", idx); + child = ofw_bus_find_child(node, portnode); + if (child != 0) + return (child); + + /* Next try to look under ports */ + ports = ofw_bus_find_child(node, "ports"); + if (ports == 0) + return (0); + + for (child = OF_child(ports); child != 0; child = OF_peer(child)) { + if (OF_getencprop(child, "reg", ®, sizeof(uint32_t)) <= 0 || + reg != idx) + continue; + + return (child); + } + + return (0); +} + +size_t +ofw_graph_port_get_num_endpoints(phandle_t port) +{ + phandle_t child; + char *name; + size_t num = 0; + int ret; + + for (num = 0, child = OF_child(port); child != 0; + child = OF_peer(child)) { + ret = OF_getprop_alloc(child, "name", (void **)&name); + if (ret == -1) + continue; + if (strcmp(name, "endpoint") == 0) + num++; + else if (strncmp(name, "endpoint@", 9) == 0) + num++; + free(name, M_OFWPROP); + } + + return (num); +} + +phandle_t +ofw_graph_get_endpoint_by_idx(phandle_t port, uint32_t idx) +{ + phandle_t endpoint, child; + uint32_t reg; + + /* First test if we have only one endpoint */ + endpoint = ofw_bus_find_child(port, "endpoint"); + if (endpoint != 0) + return (endpoint); + + /* Then test all childs based on the reg property */ + for (child = OF_child(port); child != 0; child = OF_peer(child)) { + if (OF_getencprop(child, "reg", ®, sizeof(uint32_t)) <= 0 || + reg != idx) + continue; + + return (child); + } + + return (0); +} + +phandle_t +ofw_graph_get_remote_endpoint(phandle_t endpoint) +{ + phandle_t remote; + + if (OF_getencprop(endpoint, "remote-endpoint", &remote, + sizeof(phandle_t)) <= 0) + return (0); + + return (remote); +} + +phandle_t +ofw_graph_get_remote_parent(phandle_t remote) +{ + phandle_t node; + char *name; + int ret; + + /* get the endpoint node */ + node = OF_node_from_xref(remote); + + /* go to the port@X node */ + node = OF_parent(node); + /* go to the ports node or parent */ + node = OF_parent(node); + + /* if the node name is 'ports' we need to go up one last time */ + ret = OF_getprop_alloc(node, "name", (void **)&name); + if (ret == -1) { + printf("%s: Node %x don't have a name, abort\n", __func__, node); + node = 0; + goto end; + } + if (strcmp("ports", name) == 0) + node = OF_parent(node); + +end: + free(name, M_OFWPROP); + return (node); +} + +device_t +ofw_graph_get_device_by_port_ep(phandle_t node, uint32_t port_id, uint32_t ep_id) +{ + phandle_t outport, port, endpoint, remote; + + port = ofw_graph_get_port_by_idx(node, port_id); + if (port == 0) + return (NULL); + endpoint = ofw_graph_get_endpoint_by_idx(port, ep_id); + if (endpoint == 0) + return NULL; + remote = ofw_graph_get_remote_endpoint(endpoint); + if (remote == 0) + return (NULL); + outport = ofw_graph_get_remote_parent(remote); + if (outport == 0) + return (NULL); + + return (OF_device_from_xref(OF_xref_from_node(outport))); +} Added: head/sys/dev/ofw/ofw_graph.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_graph.h Wed Apr 17 20:09:01 2019 (r346332) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OFW_GRAPH_H_ +#define _OFW_GRAPH_H_ + +phandle_t ofw_graph_get_port_by_idx(phandle_t node, uint32_t idx); +phandle_t ofw_graph_get_remote_endpoint(phandle_t endpoint); +size_t ofw_graph_port_get_num_endpoints(phandle_t port); +phandle_t ofw_graph_get_endpoint_by_idx(phandle_t port, uint32_t idx); +phandle_t ofw_graph_get_remote_parent(phandle_t remote); + +device_t ofw_graph_get_device_by_port_ep(phandle_t node, uint32_t port_id, uint32_t ep_id); + +#endif /* _OFW_GRAPH_H_ */ + From owner-svn-src-head@freebsd.org Wed Apr 17 21:17:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D3F1579F25; Wed, 17 Apr 2019 21:17:27 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47EFC943D8; Wed, 17 Apr 2019 21:17:26 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x3HLHIx9060586 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 17 Apr 2019 14:17:18 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x3HLHIxr060585; Wed, 17 Apr 2019 14:17:18 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 17 Apr 2019 14:17:18 -0700 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346319 - head/sys/netpfil/pf Message-ID: <20190417211718.GX1243@FreeBSD.org> References: <201904171642.x3HGgslA075253@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904171642.x3HGgslA075253@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 47EFC943D8 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.988,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, 17 Apr 2019 21:17:28 -0000 Kristof, On Wed, Apr 17, 2019 at 04:42:54PM +0000, Kristof Provost wrote: K> Modified: head/sys/netpfil/pf/pf_ioctl.c K> ============================================================================== K> --- head/sys/netpfil/pf/pf_ioctl.c Wed Apr 17 16:31:30 2019 (r346318) K> +++ head/sys/netpfil/pf/pf_ioctl.c Wed Apr 17 16:42:54 2019 (r346319) K> @@ -3103,24 +3103,24 @@ DIOCCHANGEADDR_error: K> break; K> } K> K> - PF_RULES_WLOCK(); K> + PF_RULES_RLOCK(); K> n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); K> io->pfrio_size = min(io->pfrio_size, n); K> + PF_RULES_RUNLOCK(); K> K> totlen = io->pfrio_size * sizeof(struct pfr_table); K> pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), K> M_TEMP, M_NOWAIT); K> if (pfrts == NULL) { K> error = ENOMEM; K> - PF_RULES_WUNLOCK(); K> break; K> } K> error = copyin(io->pfrio_buffer, pfrts, totlen); K> if (error) { K> free(pfrts, M_TEMP); K> - PF_RULES_WUNLOCK(); K> break; K> } K> + PF_RULES_WLOCK(); K> error = pfr_set_tflags(pfrts, io->pfrio_size, K> io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, K> &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); Couple comments: 1) Now we can malloc with M_WAITOK. 2) Are we sure that table count won't change while we dropped the lock? -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Apr 17 21:45:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84473157AA74; Wed, 17 Apr 2019 21:45:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 26715953E7; Wed, 17 Apr 2019 21:45:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14B29D446; Wed, 17 Apr 2019 21:45:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3HLjJSt035505; Wed, 17 Apr 2019 21:45:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3HLjJ22035504; Wed, 17 Apr 2019 21:45:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201904172145.x3HLjJ22035504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Apr 2019 21:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346334 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 346334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26715953E7 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)[-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: Wed, 17 Apr 2019 21:45:20 -0000 Author: manu Date: Wed Apr 17 21:45:19 2019 New Revision: 346334 URL: https://svnweb.freebsd.org/changeset/base/346334 Log: arm: allwinner: Fix audio for Allwinner H3/H5 Due to three conditions the codec driver for Allwinner A10/A20 and H3/H5 did not work properly here: Wrong bit position for the analog audio reset Hardware Reset of codec was not de-asserted correctly Linux DTS file did not contain the address of the analog register the way as the driver was expecting it. This patch proposes fixes for those three parts. Submitted by: freebsdnewbie@freenet.de (Manuel Stühn) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19910 Modified: head/sys/arm/allwinner/a10_codec.c Modified: head/sys/arm/allwinner/a10_codec.c ============================================================================== --- head/sys/arm/allwinner/a10_codec.c Wed Apr 17 20:16:48 2019 (r346333) +++ head/sys/arm/allwinner/a10_codec.c Wed Apr 17 21:45:19 2019 (r346334) @@ -164,7 +164,7 @@ struct a10codec_chinfo { struct a10codec_info { device_t dev; - struct resource *res[3]; + struct resource *res[2]; struct mtx *lock; bus_dma_tag_t dmat; unsigned dmasize; @@ -178,11 +178,12 @@ struct a10codec_info { static struct resource_spec a10codec_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_MEMORY, 1, RF_ACTIVE | RF_OPTIONAL }, - { SYS_RES_IRQ, 0, RF_ACTIVE }, { -1, 0 } }; +#define CODEC_ANALOG_READ(sc, reg) bus_read_4((sc)->res[1], (reg)) +#define CODEC_ANALOG_WRITE(sc, reg, val) bus_write_4((sc)->res[1], (reg), (val)) + #define CODEC_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) #define CODEC_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) @@ -372,7 +373,7 @@ MIXER_DECLARE(a10_mixer); */ #define H3_PR_CFG 0x00 -#define H3_AC_PR_RST (1 << 18) +#define H3_AC_PR_RST (1 << 28) #define H3_AC_PR_RW (1 << 24) #define H3_AC_PR_ADDR_SHIFT 16 #define H3_AC_PR_ADDR_MASK (0x1f << H3_AC_PR_ADDR_SHIFT) @@ -424,23 +425,23 @@ h3_pr_read(struct a10codec_info *sc, u_int addr) uint32_t val; /* Read current value */ - val = bus_read_4(sc->res[1], H3_PR_CFG); + val = CODEC_ANALOG_READ(sc, H3_PR_CFG); /* De-assert reset */ val |= H3_AC_PR_RST; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Read mode */ val &= ~H3_AC_PR_RW; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Set address */ val &= ~H3_AC_PR_ADDR_MASK; val |= (addr << H3_AC_PR_ADDR_SHIFT); - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Read data */ - return (bus_read_4(sc->res[1], H3_PR_CFG) & H3_ACDA_PR_RDAT_MASK); + return (CODEC_ANALOG_READ(sc , H3_PR_CFG) & H3_ACDA_PR_RDAT_MASK); } static void @@ -449,25 +450,25 @@ h3_pr_write(struct a10codec_info *sc, u_int addr, u_in uint32_t val; /* Read current value */ - val = bus_read_4(sc->res[1], H3_PR_CFG); + val = CODEC_ANALOG_READ(sc, H3_PR_CFG); /* De-assert reset */ val |= H3_AC_PR_RST; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Set address */ val &= ~H3_AC_PR_ADDR_MASK; val |= (addr << H3_AC_PR_ADDR_SHIFT); - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Write data */ val &= ~H3_ACDA_PR_WDAT_MASK; val |= (data << H3_ACDA_PR_WDAT_SHIFT); - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Write mode */ val |= H3_AC_PR_RW; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); } static void @@ -483,8 +484,28 @@ h3_pr_set_clear(struct a10codec_info *sc, u_int addr, static int h3_mixer_init(struct snd_mixer *m) { + int rid=1; + pcell_t reg[2]; + phandle_t analogref; struct a10codec_info *sc = mix_getdevinfo(m); + if (OF_getencprop(ofw_bus_get_node(sc->dev), "allwinner,codec-analog-controls", + &analogref, sizeof(analogref)) <= 0) { + return (ENXIO); + } + + if (OF_getencprop(OF_node_from_xref(analogref), "reg", + reg, sizeof(reg)) <= 0) { + return (ENXIO); + } + + sc->res[1] = bus_alloc_resource(sc->dev, SYS_RES_MEMORY, &rid, reg[0], + reg[0]+reg[1], reg[1], RF_ACTIVE ); + + if (sc->res[1] == NULL) { + return (ENXIO); + } + mix_setdevs(m, SOUND_MASK_PCM | SOUND_MASK_VOLUME | SOUND_MASK_RECLEV | SOUND_MASK_MIC | SOUND_MASK_LINE | SOUND_MASK_LINE1); mix_setrecdevs(m, SOUND_MASK_MIC | SOUND_MASK_LINE | SOUND_MASK_LINE1 | @@ -940,6 +961,7 @@ a10codec_chan_trigger(kobj_t obj, void *data, int go) switch (go) { case PCMTRIG_START: ch->run = 1; + a10codec_stop(ch); a10codec_start(ch); break; case PCMTRIG_STOP: @@ -1124,8 +1146,7 @@ a10codec_attach(device_t dev) } /* De-assert hwreset */ - if (hwreset_get_by_ofw_name(dev, 0, "apb", &rst) == 0 || - hwreset_get_by_ofw_name(dev, 0, "ahb", &rst) == 0) { + if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst) == 0) { error = hwreset_deassert(rst); if (error != 0) { device_printf(dev, "cannot de-assert reset\n"); @@ -1137,15 +1158,6 @@ a10codec_attach(device_t dev) val = CODEC_READ(sc, AC_DAC_DPC(sc)); val |= DAC_DPC_EN_DA; CODEC_WRITE(sc, AC_DAC_DPC(sc), val); - -#ifdef notdef - error = snd_setup_intr(dev, sc->irq, INTR_MPSAFE, a10codec_intr, sc, - &sc->ih); - if (error != 0) { - device_printf(dev, "could not setup interrupt handler\n"); - goto fail; - } -#endif if (mixer_init(dev, sc->cfg->mixer_class, sc)) { device_printf(dev, "mixer_init failed\n"); From owner-svn-src-head@freebsd.org Wed Apr 17 22:05:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43625157AE9F; Wed, 17 Apr 2019 22:05:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D22D295BE8; Wed, 17 Apr 2019 22:05:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 6C28F10F0; Wed, 17 Apr 2019 22:05:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [192.168.228.1] (host1.test.ravensoft.telecomplete.net [213.160.118.146]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 4E0E51A8BE; Thu, 18 Apr 2019 00:05:29 +0200 (CEST) From: "Kristof Provost" To: "Gleb Smirnoff" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346319 - head/sys/netpfil/pf Date: Wed, 17 Apr 2019 23:05:26 +0100 X-Mailer: MailMate (2.0BETAr6135) Message-ID: <8B606261-B614-474F-AA73-217FE09E28BA@FreeBSD.org> In-Reply-To: <20190417211718.GX1243@FreeBSD.org> References: <201904171642.x3HGgslA075253@repo.freebsd.org> <20190417211718.GX1243@FreeBSD.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: D22D295BE8 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.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown 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: Wed, 17 Apr 2019 22:05:33 -0000 On 17 Apr 2019, at 22:17, Gleb Smirnoff wrote: > Kristof, > > On Wed, Apr 17, 2019 at 04:42:54PM +0000, Kristof Provost wrote: > K> Modified: head/sys/netpfil/pf/pf_ioctl.c > K> > ============================================================================== > K> --- head/sys/netpfil/pf/pf_ioctl.c Wed Apr 17 16:31:30 > 2019 (r346318) > K> +++ head/sys/netpfil/pf/pf_ioctl.c Wed Apr 17 16:42:54 > 2019 (r346319) > K> @@ -3103,24 +3103,24 @@ DIOCCHANGEADDR_error: > K> break; > K> } > K> > K> - PF_RULES_WLOCK(); > K> + PF_RULES_RLOCK(); > K> n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); > K> io->pfrio_size = min(io->pfrio_size, n); > K> + PF_RULES_RUNLOCK(); > K> > K> totlen = io->pfrio_size * sizeof(struct pfr_table); > K> pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), > K> M_TEMP, M_NOWAIT); > K> if (pfrts == NULL) { > K> error = ENOMEM; > K> - PF_RULES_WUNLOCK(); > K> break; > K> } > K> error = copyin(io->pfrio_buffer, pfrts, totlen); > K> if (error) { > K> free(pfrts, M_TEMP); > K> - PF_RULES_WUNLOCK(); > K> break; > K> } > K> + PF_RULES_WLOCK(); > K> error = pfr_set_tflags(pfrts, io->pfrio_size, > K> io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, > K> &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); > > Couple comments: > > 1) Now we can malloc with M_WAITOK. > That’s a good point. I’ll see about changing that tomorrow. > 2) Are we sure that table count won't change while we dropped the > lock? > No, the table count can indeed change while we’re unlocked. It doesn’t really matter though. The initial count only serves to limit the memory allocation to something sane. pfr_set_tflags() still does appropriate checks. It’s always been possible for the table count to change between user space preparing its request and it being handled in the kernel, so that was always a possibility. Regards, Kristof From owner-svn-src-head@freebsd.org Wed Apr 17 22:05:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8951157AEC7; Wed, 17 Apr 2019 22:05:44 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 64FF795CA8; Wed, 17 Apr 2019 22:05:43 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3HM5bPV002270; Wed, 17 Apr 2019 15:05:37 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3HM5bur002269; Wed, 17 Apr 2019 15:05:37 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904172205.x3HM5bur002269@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc In-Reply-To: <201904171941.x3HJfmee090931@slippy.cwsent.com> To: Cy Schubert Date: Wed, 17 Apr 2019 15:05:37 -0700 (PDT) CC: "O. Hartmann" , Ed Maste , 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: 64FF795CA8 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.964,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: Wed, 17 Apr 2019 22:05:45 -0000 > In message <20190417195145.6824c0f9@thor.intern.walstatt.dynvpn.de>, > "O. Hartma > nn" writes: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA256 > > > > Am Wed, 17 Apr 2019 16:18:14 +0000 (UTC) > > Ed Maste schrieb: > > > > > Author: emaste > > > Date: Wed Apr 17 16:18:14 2019 > > > New Revision: 346316 > > > URL: https://svnweb.freebsd.org/changeset/base/346316 > > > > > > Log: > > > cap_fileargs: chase r346315, update fileargs_init in consumers > > > > > > Reported by: ci.freebsd.org (8 times so far) > > > MFC after: 3 weeks > > > MFC with: r346315 > > > Sponsored by: The FreeBSD Foundation > > > > > > Modified: > > > head/contrib/elftoolchain/strings/strings.c > > > head/sbin/savecore/savecore.c > > > head/usr.bin/brandelf/brandelf.c > > > head/usr.bin/head/head.c > > > head/usr.bin/wc/wc.c > > > > > > Modified: head/contrib/elftoolchain/strings/strings.c > > > =========================================================================== > > === > > > --- head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:02:57 201 > > 9 > > > (r346315) +++ head/contrib/elftoolchain/strings/strings.c Wed Apr 17 16:1 > > 8:14 > > > 2019 (r346316) @@ -195,7 +195,7 @@ main(int argc, char **argv) > > > argv += optind; > > > > > > cap_rights_init(&rights, CAP_READ, CAP_SEEK, CAP_FSTAT, CAP_FCNTL); > > > - fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights); > > > + fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > > if (fa == NULL) > > > err(1, "Unable to initialize casper fileargs"); > > > > > > > > > Modified: head/sbin/savecore/savecore.c > > > =========================================================================== > > === > > > --- head/sbin/savecore/savecore.c Wed Apr 17 16:02:57 2019 (r34631 > > 5) > > > +++ head/sbin/savecore/savecore.c Wed Apr 17 16:18:14 2019 (r34631 > > 6) > > > @@ -1030,7 +1030,7 @@ init_caps(int argc, char **argv) > > > */ > > > (void)cap_rights_init(&rights, CAP_PREAD, CAP_WRITE, CAP_IOCTL); > > > capfa = fileargs_init(argc, argv, checkfor || keep ? O_RDONLY : O_RDWR, > > > - 0, &rights); > > > + 0, &rights, FA_OPEN); > > > if (capfa == NULL) { > > > logmsg(LOG_ERR, "fileargs_init(): %m"); > > > exit(1); > > > > > > Modified: head/usr.bin/brandelf/brandelf.c > > > =========================================================================== > > === > > > --- head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:02:57 2019 > > (r346315) > > > +++ head/usr.bin/brandelf/brandelf.c Wed Apr 17 16:18:14 2019 > > (r346316) > > > @@ -133,7 +133,7 @@ main(int argc, char **argv) > > > if (flags == O_RDWR) > > > cap_rights_set(&rights, CAP_WRITE); > > > > > > - fa = fileargs_init(argc, argv, flags, 0, &rights); > > > + fa = fileargs_init(argc, argv, flags, 0, &rights, FA_OPEN); > > > if (fa == NULL) > > > errx(1, "unable to init casper"); > > > > > > > > > Modified: head/usr.bin/head/head.c > > > =========================================================================== > > === > > > --- head/usr.bin/head/head.c Wed Apr 17 16:02:57 2019 (r34631 > > 5) > > > +++ head/usr.bin/head/head.c Wed Apr 17 16:18:14 2019 (r34631 > > 6) > > > @@ -115,7 +115,7 @@ main(int argc, char *argv[]) > > > argv += optind; > > > > > > fa = fileargs_init(argc, argv, O_RDONLY, 0, > > > - cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL)); > > > + cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL), FA_OPEN); > > > if (fa == NULL) > > > errx(1, "unable to init casper"); > > > > > > > > > Modified: head/usr.bin/wc/wc.c > > > =========================================================================== > > === > > > --- head/usr.bin/wc/wc.c Wed Apr 17 16:02:57 2019 (r346315) > > > +++ head/usr.bin/wc/wc.c Wed Apr 17 16:18:14 2019 (r346316) > > > @@ -133,7 +133,7 @@ main(int argc, char *argv[]) > > > (void)signal(SIGINFO, siginfo_handler); > > > > > > fa = fileargs_init(argc, argv, O_RDONLY, 0, > > > - cap_rights_init(&rights, CAP_READ, CAP_FSTAT)); > > > + cap_rights_init(&rights, CAP_READ, CAP_FSTAT), FA_OPEN); > > > if (fa == NULL) { > > > xo_warn("Unable to init casper"); > > > exit(1); > > > _______________________________________________ > > > svn-src-head@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > > > This commit seems to break buildworld on my installations: > > > > [...] > > Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/strings/strings.o > > - --- strings.o --- > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of undecla > > red identifier > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > ^ > > 1 error generated. > > *** [strings.o] Error code 1 > > Try this. We shouldn't use headers in /usr/include, only the ones in > src/. > > Index: tools/build/Makefile > =================================================================== > --- tools/build/Makefile (revision 346330) > +++ tools/build/Makefile (working copy) > @@ -59,9 +59,7 @@ > INCS+= libcasper.h > .endif > > -.if !exists(/usr/include/casper/cap_fileargs.h) > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs. > h > -.endif > > .if empty(SRCS) > SRCS= dummy.c > > I found a number of bugs like this one in heimdal in base and in ntp > previously. > Cy Schubert This is in general a huge problem area dating back to when I fixed "make includes" to at least be some what correct. Rather than all these one off hacks of doing fooINC+= the make includes target should be fixed such that we boot strap a proper "includes" tree, preferable in /usr/obj/${SRCTOP} and use that in all places that need build tree (not host tree) include files. If you find yourself doing the above it means that something is missing from "make includes", as that file should of been populated into /usr/includes early in the build process. Doing the /usr/obj/${SRCTOP}/usr/include/ would fix all places that need hacks like above. Regards, Rod -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 18 00:58:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF399157EA94; Thu, 18 Apr 2019 00:58:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82DEA6CC70; Thu, 18 Apr 2019 00:58:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f67.google.com with SMTP id i21so53705iol.7; Wed, 17 Apr 2019 17:58:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i0fssQ5ZeijeH/kQvUd0Vze+UazvvBpfXl+vk1c44Dc=; b=jMBweIcGeVuqi8Xb3bptzk3ufOiRP/YR2gaZr7o4PM2H5K0MqeQvUNoFGkqAZJguZb U238Fp8C9vdl0/U2/8O6vdBR744vog8kn+CvjZ/POym/bdg9Vivdnvtq92IZvovCJKD8 M1XJrZDIMrQLqepgIub5VVoI2+jk0eZ40JbqxCV19GYiSVb9sGIWyToyGNE0sqthzrnx OX32D7Mjx9NeoBhmLSc1Rc+H/oRXRTEDKFYK9S0Ko9jH/828Gt49EMsV2r/N51vO68jf I+GIeJxQZYWsB2ztl9Dd/T6j8+fpLfcHBHruaJMhYgcG7Cgzw77xTHd/rqpf6PMo4UWK ZvmA== X-Gm-Message-State: APjAAAWnLN+rTrHan7syPWsiKW76HNtwDk8GI0QfuF4ZguOd8LkMANR8 57FgYtXPXu8bg++/x3lN1ynuwjqpYx0KiE64bV4= X-Google-Smtp-Source: APXvYqwcnDH812sUDfpUoBR0j7bJx4UlEPrMXuVEG1fyut4X5aFauwNIBuvTSk3eRBiGfhK5QbpTa9V9PrmwsZverPU= X-Received: by 2002:a6b:6006:: with SMTP id r6mr1954517iog.294.1555548643443; Wed, 17 Apr 2019 17:50:43 -0700 (PDT) MIME-Version: 1.0 References: <20190417195145.6824c0f9@thor.intern.walstatt.dynvpn.de> <201904171941.x3HJfmee090931@slippy.cwsent.com> In-Reply-To: <201904171941.x3HJfmee090931@slippy.cwsent.com> From: Ed Maste Date: Wed, 17 Apr 2019 20:50:31 -0400 Message-ID: Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc To: Cy Schubert Cc: "O. Hartmann" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 82DEA6CC70 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,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, 18 Apr 2019 00:58:42 -0000 On Wed, 17 Apr 2019 at 15:42, Cy Schubert wrote: > > -.if !exists(/usr/include/casper/cap_fileargs.h) > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs. > h > -.endif Yes I think this change is correct as an immediate workaround for this issue (until we sort out header bootstrapping in a more holistic way). Please commit it, or I will if you don't get to it soon. From owner-svn-src-head@freebsd.org Thu Apr 18 01:02:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C51157EDDB; Thu, 18 Apr 2019 01:02:01 +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 DAF666D24B; Thu, 18 Apr 2019 01:02:00 +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 7817DF69F; Thu, 18 Apr 2019 01:02:00 +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 x3I120I0040288; Thu, 18 Apr 2019 01:02:00 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3I120ms040287; Thu, 18 Apr 2019 01:02:00 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201904180102.x3I120ms040287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 18 Apr 2019 01:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346341 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 346341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAF666D24B 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.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 18 Apr 2019 01:02:01 -0000 Author: cy Date: Thu Apr 18 01:02:00 2019 New Revision: 346341 URL: https://svnweb.freebsd.org/changeset/base/346341 Log: As an interim measure until a more permanent solution is implemented workaround the following error: /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of undeclared identifier 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); Reported by: O. Hartmann Reported by: Michael Butler Reported by: gjb@ & cy@ (implicit) Reviewed by: emaste@ Noted by: rgrimes@ Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 (r346340) +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 (r346341) @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h INCS+= libcasper.h .endif -.if !exists(/usr/include/casper/cap_fileargs.h) CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.h -.endif .if empty(SRCS) SRCS= dummy.c From owner-svn-src-head@freebsd.org Thu Apr 18 01:03:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2350A157EE5B; Thu, 18 Apr 2019 01:03:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 983BE6D43A; Thu, 18 Apr 2019 01:03:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id GvS8hVc2JGusjGvSAhGI4y; Wed, 17 Apr 2019 19:03:03 -0600 X-Authority-Analysis: v=2.3 cv=fOdHIqSe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=oexKYjalfGEA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=R8O-uMdQVzs9i371vuoA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 3418ED7A; Wed, 17 Apr 2019 18:03:00 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x3I12fh4002409; Wed, 17 Apr 2019 18:02:41 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x3I12eT3002339; Wed, 17 Apr 2019 18:02:40 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201904180102.x3I12eT3002339@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: Cy Schubert , "O. Hartmann" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc In-Reply-To: Message from Ed Maste of "Wed, 17 Apr 2019 20:50:31 -0400." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 17 Apr 2019 18:02:40 -0700 X-CMAE-Envelope: MS4wfM5fmsC3J1ZoKODeHWToWp+vBx5lBQXgimOTBK4faY5z/Dd6BoCY7NsqRdA6lnHNVO8cNRKTWugbMIg4hkezO47Z6tE1wHD8IhX7jLp6Dtyj/BGEel3o IRnbkbBWe7UU3T6pZHCjaHLFzi7q78u3qzTLJDebAWWPB8aGi4tws0Kq3Wl3iYvwp4hy+dDf5K5QSGRLrIC9Z50HYEs4yMnCAX+ZgCMMHQZiDa9/P8svUhYt TGSzVzU8UkXVwz846ukoNRvoM6VM9waO0cMIMKluQwrsvlGSq0FSo2XsEmgLb/EnicYIhCqG1/tlc5J3tRcpKfgt8ol5eUOFmZtwmtQEPS4= X-Rspamd-Queue-Id: 983BE6D43A X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.35)[ip: (-6.09), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.41), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1] 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, 18 Apr 2019 01:03:13 -0000 In message , Ed Maste writes: > On Wed, 17 Apr 2019 at 15:42, Cy Schubert wrote: > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs. > > h > > -.endif > > Yes I think this change is correct as an immediate workaround for this > issue (until we sort out header bootstrapping in a more holistic way). > Please commit it, or I will if you don't get to it soon. Committed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Apr 18 01:07:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45544157EFC7; Thu, 18 Apr 2019 01:07:29 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 A19966D690; Thu, 18 Apr 2019 01:07:28 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3I17QY7002946; Wed, 17 Apr 2019 18:07:26 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3I17QDc002945; Wed, 17 Apr 2019 18:07:26 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346341 - head/tools/build In-Reply-To: <201904180102.x3I120ms040287@repo.freebsd.org> To: Cy Schubert Date: Wed, 17 Apr 2019 18:07:26 -0700 (PDT) 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: A19966D690 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 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.94)[-0.940,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, 18 Apr 2019 01:07:29 -0000 > Author: cy > Date: Thu Apr 18 01:02:00 2019 > New Revision: 346341 > URL: https://svnweb.freebsd.org/changeset/base/346341 > > Log: > As an interim measure until a more permanent solution is implemented > workaround the following error: > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of > undeclared identifier > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > Reported by: O. Hartmann > Reported by: Michael Butler > Reported by: gjb@ & cy@ (implicit) > Reviewed by: emaste@ > Noted by: rgrimes@ > > Modified: > head/tools/build/Makefile > > Modified: head/tools/build/Makefile > ============================================================================== > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 (r346340) > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 (r346341) > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > INCS+= libcasper.h > .endif > > -.if !exists(/usr/include/casper/cap_fileargs.h) > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.h > -.endif As a further note, we should probably hunt for any thing that is explicity looking at /usr/include/... in a Makefile, as that is minimally missing a ${DESTDIR} argument. The above may of actually worked if it had been written: .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) someone may wish to test that. Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake. > .if empty(SRCS) > SRCS= dummy.c -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 18 01:15:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6289E157F74E; Thu, 18 Apr 2019 01:15:49 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f196.google.com (mail-it1-f196.google.com [209.85.166.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBE366DD81; Thu, 18 Apr 2019 01:15:48 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f196.google.com with SMTP id y134so807689itc.5; Wed, 17 Apr 2019 18:15:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EDaAnmcYncE0b2BHECTYUFYLl/nial95/K3PF0ePBLw=; b=CeKbGxwb29XPI6Q5CjVSk4ADb8IpV4UULI/ij9+swdLPDTgKaZAfl6gjGVnnObQ3Hd e4qR3zr6byCPJERgi8aTKzo8RddkX5jeZYVb1cm3K+//SgDn+6d34vfruFnbRZNKxMbH 3+iXY/TJRYAEXZv/YbajZo+AYPXpcPJfK+p0D2oKpIVlx+FnQeucNs1U3Qk7xEeGTdQ6 Nl0nVI10Y6zCHJS70RD7MV2A7URnRZrFW5jYPDEd5jR/A6L6YLtl5v/HdAty+Placwip DaBBdjW2C0TkHJzBoaenv4uiFh8D34+1YQQOIU5hPtBeIO5ifq3mswtExR918x70n4Sl udqw== X-Gm-Message-State: APjAAAU6goA6O9rw+n11XBnBRZDd8LH0Y5yR9LmxDjnAhOeMbTo0nFZg 7/4ykVXRAbOUA/E1Aa/WV/yQQoDQ0ZdiK4vSTAQ= X-Google-Smtp-Source: APXvYqxA8ts/mcE/eKp/qM6nggYUOeCdhohRGQttm4vVgiL/JOBaXIqCM6UWV/PfbL/cokdeN7fg/12bUwDrz3X5MYE= X-Received: by 2002:a24:7354:: with SMTP id y81mr1237637itb.87.1555549650446; Wed, 17 Apr 2019 18:07:30 -0700 (PDT) MIME-Version: 1.0 References: <20190417195145.6824c0f9@thor.intern.walstatt.dynvpn.de> <201904171941.x3HJfmee090931@slippy.cwsent.com> In-Reply-To: From: Ed Maste Date: Wed, 17 Apr 2019 21:07:18 -0400 Message-ID: Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc To: Cy Schubert Cc: "O. Hartmann" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EBE366DD81 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,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: Thu, 18 Apr 2019 01:15:49 -0000 On Wed, 17 Apr 2019 at 20:50, Ed Maste wrote: > > On Wed, 17 Apr 2019 at 15:42, Cy Schubert wrote: > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs. > > h > > -.endif > > Yes I think this change is correct as an immediate workaround for this > issue (until we sort out header bootstrapping in a more holistic way). > Please commit it, or I will if you don't get to it soon. Or maybe this, similar to the existing tests in tools/build/Makefile: Index: tools/build/Makefile =================================================================== --- tools/build/Makefile (revision 346340) +++ tools/build/Makefile (working copy) @@ -59,7 +59,10 @@ INCS+= libcasper.h .endif -.if !exists(/usr/include/casper/cap_fileargs.h) +.if exists(/usr/include/casper/cap_fileargs.h) +_WITH_FA_OPEN!= grep -c FA_OPEN /usr/include/casper/cap_fileargs.h || true +.endif +.if !defined(_WITH_FA_OPEN) || ${_WITH_FA_OPEN} == 0 CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.h .endif From owner-svn-src-head@freebsd.org Thu Apr 18 01:17:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0212E157FA52; Thu, 18 Apr 2019 01:17:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F17B56E138; Thu, 18 Apr 2019 01:17:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Gvg7hVk4FGusjGvg9hGKGw; Wed, 17 Apr 2019 19:17:29 -0600 X-Authority-Analysis: v=2.3 cv=fOdHIqSe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=oexKYjalfGEA:10 a=xfDLHkLGAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=k8PgTzd3dCnHDGy2r_oA:9 a=CjuIK1q_8ugA:10 a=DoawHyg_QpkA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 248C2EC0; Wed, 17 Apr 2019 18:17:27 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x3I1H8wI065561; Wed, 17 Apr 2019 18:17:08 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x3I1H70l065558; Wed, 17 Apr 2019 18:17:07 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201904180117.x3I1H70l065558@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: Cy Schubert , "O. Hartmann" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc In-Reply-To: Message from Ed Maste of "Wed, 17 Apr 2019 21:07:18 -0400." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 17 Apr 2019 18:17:07 -0700 X-CMAE-Envelope: MS4wfPu6zz9jw2PCA8Y3/uiOPzmFzrX0ET9q6JejXthFvT2o1Sr9KyVKrNp3H9V3WGYIOvQS/jVMWt5T98ml3ZaChbdrIskhpMR/0ueZZi4yhRxyKtPyNySV 97mnl4lbOqXxhYBtOmJjKmKTp/g7P3N7HT62XFDdTc707628I4kElp+ODxDbZHTwQDgb3nxHrmj9jrp6y1iFQq6jJmqpQoXjh3X24FN3QyF4NNcEFopyjqpk 9+ds6SYRlaMSRLjgb/RWcXLFVcx4AwBYwA2LrXLThSFfkFRhoOppATa++0t3QKo2iZgdLREMDIrhVEOWLyEiGDGsAvd/cyQ+zghC4Cejcdo= X-Rspamd-Queue-Id: F17B56E138 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.34)[ip: (-6.05), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.41), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] 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, 18 Apr 2019 01:17:32 -0000 In message , Ed Maste writes: > On Wed, 17 Apr 2019 at 20:50, Ed Maste wrote: > > > > On Wed, 17 Apr 2019 at 15:42, Cy Schubert wrote > : > > > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filearg > s. > > > h > > > -.endif > > > > Yes I think this change is correct as an immediate workaround for this > > issue (until we sort out header bootstrapping in a more holistic way). > > Please commit it, or I will if you don't get to it soon. > > Or maybe this, similar to the existing tests in tools/build/Makefile: > > Index: tools/build/Makefile > =================================================================== > --- tools/build/Makefile (revision 346340) > +++ tools/build/Makefile (working copy) > @@ -59,7 +59,10 @@ > INCS+= libcasper.h > .endif > > -.if !exists(/usr/include/casper/cap_fileargs.h) > +.if exists(/usr/include/casper/cap_fileargs.h) > +_WITH_FA_OPEN!= grep -c FA_OPEN /usr/include/casper/cap_fileargs.h || true > +.endif > +.if !defined(_WITH_FA_OPEN) || ${_WITH_FA_OPEN} == 0 > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.h > .endif This only tests for the FA_OPEN. It will miss any new macro definitions should there be any at some point in the future. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Apr 18 01:23:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D911580294; Thu, 18 Apr 2019 01:23:16 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6F3C6E84C; Thu, 18 Apr 2019 01:23:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f194.google.com with SMTP id y204so847871itf.3; Wed, 17 Apr 2019 18:23:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M/8pk3OHNtWkWl/2CNV8byvl+QdOD+o4Q5DOsZsuvDA=; b=jZGvvHf2s1rmU4MAGU30z6P4syQXEbtDjU+x7LCCSCSle/Q/c+rPgrFnEdVP9qz+ai TTqR7ZuoCR2njLe/E9zJzKCEoTOwxU3VuQjolJ3uhR+rWRBsIAHOm9zeSewB3iILgCSo jDgh+kliiKL48gCjzjs4Tx1/OULRYoc4EPiZ/LBxps94xRiFzfvVf8O3/QS3Fu9vyr2h RgnnTve1J4ZUwN5J+ZcoviktrtIdPxAhzfMKrP77psjRcVLgo67QbYvlV+3Yp19fqSUI A1y35t1QIiOzSPzP5ZRr/OXC0PnHSGAZFgQ2zaix83jvEcifgTlFh2X7utY9ttbjE307 1HFQ== X-Gm-Message-State: APjAAAW51bDaj7ZcN6hx+AmkibbKegLFdJmmpMh5yV4OFPYd8WQwZ9Jx ydGvRhInu3XfwGDTVUSBp3WtzM11MUkTaC2YmfU= X-Google-Smtp-Source: APXvYqxj6mZX7hVlDM7Y3F8AcXCwJPlqQdx4eyRqUuKSpgS6/xPYeUwVthiM6K1wZAE/Ap3XqTPTSbdRc/7ymcUZL58= X-Received: by 2002:a24:7354:: with SMTP id y81mr1277438itb.87.1555550594688; Wed, 17 Apr 2019 18:23:14 -0700 (PDT) MIME-Version: 1.0 References: <201904180117.x3I1H70l065558@slippy.cwsent.com> In-Reply-To: <201904180117.x3I1H70l065558@slippy.cwsent.com> From: Ed Maste Date: Wed, 17 Apr 2019 21:23:02 -0400 Message-ID: Subject: Re: svn commit: r346316 - in head: contrib/elftoolchain/strings sbin/savecore usr.bin/brandelf usr.bin/head usr.bin/wc To: Cy Schubert Cc: "O. Hartmann" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A6F3C6E84C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,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: Thu, 18 Apr 2019 01:23:16 -0000 On Wed, 17 Apr 2019 at 21:17, Cy Schubert wrote: > > This only tests for the FA_OPEN. It will miss any new macro definitions > should there be any at some point in the future. Yes, this should be replaced with a more holistic approach to addressing includes. From owner-svn-src-head@freebsd.org Thu Apr 18 03:23:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2E6515858B5 for ; Thu, 18 Apr 2019 03:23:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B39F72F94 for ; Thu, 18 Apr 2019 03:23:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x842.google.com with SMTP id d13so727336qth.5 for ; Wed, 17 Apr 2019 20:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ewK9keJRP5t4VixrU6IeJSzOmWYHy/kUZx+tMORUx6k=; b=pPevSvl3PCUR6X8u66MjJCNaDmb4/yR7BIv9NLtHdHQHhB6Op/08gZzUwzTwYO8DB5 8UGoHqtdOvKFgPfUSObp/EJ1m6FMrGIXNHC7ecP4zdltPld/H8xlWuWaIA/d3brvQgCx QprZ6JSTVUgdw1tXO40AUfOwE4FPSu7NPGNq5ATk2EF7z+snl0N9h6I31cp9+lFzU0T/ SJKWvNH+Z5hMETcm2zZITThjhE1GlFii5eTHeG1HVX4RP/f/dUuvZOuH+tVOAVHiemyh 49lbKlS/X8uVlbT1cHhyQ5yTUqOFpY7mbQfl3tI5V57XwoGBx2j1fUMF2rjwHSQADqZs jSoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ewK9keJRP5t4VixrU6IeJSzOmWYHy/kUZx+tMORUx6k=; b=K/tjF24xXVRIYIgt/QxAS8292dfzwsS5T5z8RauXKZd3b7NQDDbstgyLPypJt1v8Ga +/HauG72jHhT5joYyF7QNbML9PFniLK+sgxwXM0aVB0G9l8V2+a0LAVdmMeFKpDRCnKY 8WnNT7nk4JLJrRDN14f3zDwWAQS1uPnsmc+21mw3OC97SXSl8RctEdOssw1r1+Jrrj63 4VGYkd7f+tYOO4zrFpEm7VO18yL+Vu23J8WSD4iqfQ20Rj+zSNu6Zs2JhqvB3rgctdgj tfKGFRurf4cq9B7cUOCKBig/ngYFR+Ps5rDrLmCCAZITSv07EDGGOSsh0rjFN7jpYTh3 AORg== X-Gm-Message-State: APjAAAWu/QOwENUHgCh2gwAQOUO6tNHsTWGt6XFpUWphsVJBVagNwyQh 7SLLUGQpK99bNpXilt75uEquYOdf/96E8GTz4/U8HQ== X-Google-Smtp-Source: APXvYqx0RNSiNB2qxcrqVZir/n3vYHDyTrTP/toP3wA5m/3ZHsvumKdFRzvkumuMha57xPZjTrTudiLbFPgR4UIabEQ= X-Received: by 2002:a0c:ba10:: with SMTP id w16mr75026184qvf.115.1555557812546; Wed, 17 Apr 2019 20:23:32 -0700 (PDT) MIME-Version: 1.0 References: <201904162004.x3GK4N7u019636@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 17 Apr 2019 21:23:21 -0600 Message-ID: Subject: Re: svn commit: r346295 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124 a... To: Andrew Turner Cc: Ian Lepore , Emmanuel Vadot , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 5B39F72F94 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.950,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: Thu, 18 Apr 2019 03:23:34 -0000 On Wed, Apr 17, 2019 at 12:06 PM Andrew Turner wrote= : > > > On 17 Apr 2019, at 17:52, Ian Lepore wrote: > > On Wed, 2019-04-17 at 11:23 +0200, Andrew Turner wrote: > > On 16 Apr 2019, at 22:04, Emmanuel Vadot wrote: > > Author: manu > Date: Tue Apr 16 20:04:22 2019 > New Revision: 346295 > URL: https://svnweb.freebsd.org/changeset/base/346295 > > Log: > arm: Add kern_clocksource.c directly in files.arm > > This files is needed and included in all our config so move it to > a common > location. > > MFC after: 2 weeks > > > ... > > Modified: head/sys/conf/files.arm > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- head/sys/conf/files.arm Tue Apr 16 19:46:02 2019 (r346294) > +++ head/sys/conf/files.arm Tue Apr 16 20:04:22 2019 (r346295) > @@ -11,6 +11,9 @@ cloudabi32_vdso_blob.o optional com > pat_cloudabi32 \ > no-implicit-rule \ > clean "cloudabi32_vdso_blob.o" > # > + > +kern/kern_clocksource.c standard > > > Could this be moved from the various files.* to files? It seems we > define it as standard on all architectures. > > > > I thought mips still had some variants that didn't implement event > timers. That's why this stuff was ever in arch-specific files, arm and > mips had some flavors without ET support. > > > I think it used to be the case on arm. A grep seems to think it=E2=80=99s= enabled > on all architectures now: > > grep kern_clocksource files.* > files.amd64:kern/kern_clocksource.c standard > files.arm:kern/kern_clocksource.c standard > files.arm64:kern/kern_clocksource.c standard > files.i386:kern/kern_clocksource.c standard > files.mips:kern/kern_clocksource.c standard > files.powerpc:kern/kern_clocksource.c standard > files.riscv:kern/kern_clocksource.c standard > files.sparc64:kern/kern_clocksource.c standard > Looks like it can be hoisted and required for all new architectures. Warner From owner-svn-src-head@freebsd.org Thu Apr 18 03:32:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A3331585DFE; Thu, 18 Apr 2019 03:32:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9980C73590; Thu, 18 Apr 2019 03:32:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id GxmfhXZMZldkPGxmgh9s6q; Wed, 17 Apr 2019 21:32:23 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=oexKYjalfGEA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=iaTFZB6CAAAA:8 a=zxA2vyXaAAAA:8 a=YxBL1-UpAAAA:8 a=o9UH0ns-ChN0zhiAKN8A:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=nK2txNHJmq7TfjpuLlwI:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 5510C5F9; Wed, 17 Apr 2019 20:32:20 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x3I3WKT9096495; Wed, 17 Apr 2019 20:32:20 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x3I3WJTt096491; Wed, 17 Apr 2019 20:32:19 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201904180332.x3I3WJTt096491@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346341 - head/tools/build In-Reply-To: Message from "Rodney W. Grimes" of "Wed, 17 Apr 2019 18:07:26 -0700." <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 17 Apr 2019 20:32:19 -0700 X-CMAE-Envelope: MS4wfFa9WCV4vGiRNi64+Xc2puERGOfhdRwvPfsLMCQcq+lqiSBkvqgmiojF9vDBVhPpr6qX8jXQ3VoNYpu1b42jUBtgv5Jj8EmUzzWVni3T22ver7kX5pi0 f1T6dBoO4W7Kcdou+FSkVh2Y+5SA4dG3Ale6KWyjyWt/Bcajp4hCef3Om++kixOaW9lxC2WynWisQgGukhaKqynuvLFmOdkffN0pSJmH/IDCtAAldqfUoQlu AtyF7kL+0F9lLdWLXyzNRUwWBMv2M46Jpjv4O7oJmn23rVY2YM1ssgEEZhPLqLf4KVrFkjECEuECE+XKODo2EA== X-Rspamd-Queue-Id: 9980C73590 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.11 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.44)[ip: (-6.55), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.41), country: CA(-0.09)]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1] 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, 18 Apr 2019 03:32:27 -0000 In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > Author: cy > > Date: Thu Apr 18 01:02:00 2019 > > New Revision: 346341 > > URL: https://svnweb.freebsd.org/changeset/base/346341 > > > > Log: > > As an interim measure until a more permanent solution is implemented > > workaround the following error: > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of > > undeclared identifier > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > > > Reported by: O. Hartmann > > Reported by: Michael Butler > > Reported by: gjb@ & cy@ (implicit) > > Reviewed by: emaste@ > > Noted by: rgrimes@ > > > > Modified: > > head/tools/build/Makefile > > > > Modified: head/tools/build/Makefile > > =========================================================================== > === > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 (r34634 > 0) > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 (r34634 > 1) > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > > INCS+= libcasper.h > > .endif > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea > rgs.h > > -.endif > > As a further note, we should probably hunt for any thing > that is explicity looking at /usr/include/... in a Makefile, > as that is minimally missing a ${DESTDIR} argument. > > The above may of actually worked if it had been written: > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > someone may wish to test that. > > Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake. This is a better solution. I tested this in a tree with a duplicated environment: Problem solved. Before this is committed it should be tested on one of the universe machines. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Apr 18 03:59:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BF0D1586A74 for ; Thu, 18 Apr 2019 03:59:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAEC074954 for ; Thu, 18 Apr 2019 03:59:00 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555559939; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=MmP13xKm/TcTfjxkNrmvJMXOi10cxDdFfArp0kOIt1TAvFLMQehkLylljbtTpXQEwSi9SLlJbKpTj y/VgiU/1+M4WtM0wONhtbYRZP801om19plVf2eJYr7kbjBGFQcBis/CAfEQslMDE2FweM0VWAqvJx+ R7U+cAMoa2s3cf1S3EcSUT+1uI5p7nXXjhvOYEa8mGHhC8LnBVH2IqPmsMV4dvROXFiAzazkVOp4U1 S1JobSXQY44FGw1C9OBZgGRqNbXMmuTtefyDr4jYnIhigLRNRASsTrlStMkkMxWPgCzQHhgWysFF5S w3kCOogY6uk2DWUd49Svz6w6FjNWf+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=9xBd3RRjOpajcMhiX5EWBANgA0MbD9QOp9d3myxnPU8=; b=PXTyQvL5gUiBUjBi8lt44jWgG64GnrEOXCg9nnz5cGNCZBHSojqGYP1gCj6QsaY6w+pHZA1r+n3iy J5sxX8yBPh+9A27aP9+XxjcUTRzvBhuzolxJtqeEtKVRJQ+hMyQMTcKaXvjeeVtnCbfKK03VyI5yar 4tD0LboId81w4jPfHqzU8euwYUoyqXbSwX0g2d/YQTGKit13dmYCrk5sPPms/ZvRVv2nhC8hCgy8lF uh0ZBdrbvKOIUXjFpySFvRS56gd2j2Lzhu9Yi4QQ+aH2BJxTahSAdzoHEGSwHZFPAuihPzWHIf6lb3 6wVXgV4sUKVYYb2OzFME4dbAK+xLRog== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=9xBd3RRjOpajcMhiX5EWBANgA0MbD9QOp9d3myxnPU8=; b=o+DGenKAJ1VMoKZQEs8eHdER6LDMPhkPtUFmsDTQalkyg7GAKu3Jc9nK5IIEKy+x5blmSyHyjNRz9 kmvQHe0X5kTPeZxKpcwlRRDNLRat9ZoLOMxboNFAYZsZXoR3FMr1beeMKOGk3VFrAxkcegiAH5Lr91 yiYw2pSp2a8Fzw/oErlE+ykx0nZ/IVpxLdIBnun2Rmt11KJrab8SrOYXf5jeefIym98sGBjmXKNx1+ h9wZGwqMGmOCwnMDTIlJH2Lnfm/iifVhUr9tKKrOxF1uKrFR1c2D7tDYMAnLxdlbfJ/URDmUdsor2N UweTzqtLl97QqYBVJMbDlpZuV1XmgaQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 49b6675b-618e-11e9-919f-112c64a8cf29 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 49b6675b-618e-11e9-919f-112c64a8cf29; Thu, 18 Apr 2019 03:58:57 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3I3wthg049245; Wed, 17 Apr 2019 21:58:55 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r346341 - head/tools/build From: Ian Lepore To: Cy Schubert , rgrimes@freebsd.org Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 17 Apr 2019 21:58:55 -0600 In-Reply-To: <201904180332.x3I3WJTt096491@slippy.cwsent.com> References: <201904180332.x3I3WJTt096491@slippy.cwsent.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DAEC074954 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.991,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, 18 Apr 2019 03:59:01 -0000 On Wed, 2019-04-17 at 20:32 -0700, Cy Schubert wrote: > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, "Rodney > W. > Grimes" > writes: > > > Author: cy > > > Date: Thu Apr 18 01:02:00 2019 > > > New Revision: 346341 > > > URL: https://svnweb.freebsd.org/changeset/base/346341 > > > > > > Log: > > > As an interim measure until a more permanent solution is > > > implemented > > > workaround the following error: > > > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: > > > use of > > > undeclared identifier > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, > > > FA_OPEN); > > > > > > Reported by: O. Hartmann > > > Reported by: Michael Butler > > > Reported by: gjb@ & cy@ (implicit) > > > Reviewed by: emaste@ > > > Noted by: rgrimes@ > > > > > > Modified: > > > head/tools/build/Makefile > > > > > > Modified: head/tools/build/Makefile > > > ================================================================= > > > ========== > > > > === > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 ( > > > r34634 > > > > 0) > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 ( > > > r34634 > > > > 1) > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > > > INCS+= libcasper.h > > > .endif > > > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/c > > > ap_filea > > > > rgs.h > > > -.endif > > > > As a further note, we should probably hunt for any thing > > that is explicity looking at /usr/include/... in a Makefile, > > as that is minimally missing a ${DESTDIR} argument. > > > > The above may of actually worked if it had been written: > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > > someone may wish to test that. > > > > Also a pathname rooted at / without ${DESTDIR} is almost certainly > > a mistake. > > This is a better solution. I tested this in a tree with a duplicated > environment: Problem solved. Before this is committed it should be > tested on one of the universe machines. > > I'm having a hard time understanding how adding $DESTDIR is any kind of solution to something that happens at build time as opposed to install time. I typically run buildworld/kernel without DESTDIR defined. -- Ian From owner-svn-src-head@freebsd.org Thu Apr 18 04:06:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46DC31586E87; Thu, 18 Apr 2019 04:06:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5531674DD4; Thu, 18 Apr 2019 04:06:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id GyJ9hl9Cfo7SQGyJAh1tID; Wed, 17 Apr 2019 22:05:58 -0600 X-Authority-Analysis: v=2.3 cv=Go88BX9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=oexKYjalfGEA:10 a=6I5d2MoRAAAA:8 a=iKhvJSA4AAAA:8 a=iaTFZB6CAAAA:8 a=zxA2vyXaAAAA:8 a=YxBL1-UpAAAA:8 a=L7ZJcP9EYGOl6B3A_wAA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=odh9cflL3HIXMm4fY7Wr:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=nK2txNHJmq7TfjpuLlwI:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E20546D5; Wed, 17 Apr 2019 21:05:54 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x3I45sIc050488; Wed, 17 Apr 2019 21:05:54 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x3I45sQo050485; Wed, 17 Apr 2019 21:05:54 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201904180405.x3I45sQo050485@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ian Lepore cc: Cy Schubert , rgrimes@freebsd.org, Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346341 - head/tools/build In-Reply-To: Message from Ian Lepore of "Wed, 17 Apr 2019 21:58:55 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 17 Apr 2019 21:05:54 -0700 X-CMAE-Envelope: MS4wfExrx2ewOWNds1FaxKlSB4fCz3lG4cQl2/6A8+VhAQ0KQfYJ8uhMfjwRrfAH/U8sN/UTBrq7hSt8K2JRjWwaNP+4dmS79q60UK7BFFgXEHY6E9O84OGm aTjEtHGYavt/aMs9uqa2eT3eu+uv8qQUZTmkAEQKLTZej2/PE6WMhfb0fD/ZD5mOrw0ej4G9e8+JEwEVA2gwfAu2l9rVoi1BUglkZmazaythsnQgl6epYD1m llGh5RfjG1hyDIgtI1v4xdy7K2qxl94WhcYc0R6941i1HMCDiQaiNuiblievgB/+2XJTeEmzsqz6fvGgweYmHNlGUu49p87I+O6ar/29aD0= X-Rspamd-Queue-Id: 5531674DD4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.33)[ip: (-6.01), ipnet: 64.59.128.0/20(-3.14), asn: 6327(-2.40), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1] 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, 18 Apr 2019 04:06:02 -0000 In message , Ian Le pore writes: > On Wed, 2019-04-17 at 20:32 -0700, Cy Schubert wrote: > > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, "Rodney > > W. > > Grimes" > > writes: > > > > Author: cy > > > > Date: Thu Apr 18 01:02:00 2019 > > > > New Revision: 346341 > > > > URL: https://svnweb.freebsd.org/changeset/base/346341 > > > > > > > > Log: > > > > As an interim measure until a more permanent solution is > > > > implemented > > > > workaround the following error: > > > > > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: > > > > use of > > > > undeclared identifier > > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, > > > > FA_OPEN); > > > > > > > > Reported by: O. Hartmann > > > > Reported by: Michael Butler > > > > Reported by: gjb@ & cy@ (implicit) > > > > Reviewed by: emaste@ > > > > Noted by: rgrimes@ > > > > > > > > Modified: > > > > head/tools/build/Makefile > > > > > > > > Modified: head/tools/build/Makefile > > > > ================================================================= > > > > ========== > > > > > > === > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 ( > > > > r34634 > > > > > > 0) > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 ( > > > > r34634 > > > > > > 1) > > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > > > > INCS+= libcasper.h > > > > .endif > > > > > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/c > > > > ap_filea > > > > > > rgs.h > > > > -.endif > > > > > > As a further note, we should probably hunt for any thing > > > that is explicity looking at /usr/include/... in a Makefile, > > > as that is minimally missing a ${DESTDIR} argument. > > > > > > The above may of actually worked if it had been written: > > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > > > someone may wish to test that. > > > > > > Also a pathname rooted at / without ${DESTDIR} is almost certainly > > > a mistake. > > > > This is a better solution. I tested this in a tree with a duplicated > > environment: Problem solved. Before this is committed it should be > > tested on one of the universe machines. > > > > > > I'm having a hard time understanding how adding $DESTDIR is any kind of > solution to something that happens at build time as opposed to install > time. I typically run buildworld/kernel without DESTDIR defined. $DESTDIR is also used as a destination for the temporary build directory $WORLDTMP, i.e. /usr/obj/${ARCH}/tmp, also known as $SYSROOT. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Apr 18 05:37:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CD7A15888EE; Thu, 18 Apr 2019 05:37:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 0F07D771B0; Thu, 18 Apr 2019 05:37:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C715B1A750; Thu, 18 Apr 2019 05:37:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3I5bITa082997; Thu, 18 Apr 2019 05:37:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3I5bIDQ082996; Thu, 18 Apr 2019 05:37:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904180537.x3I5bIDQ082996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Apr 2019 05:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346345 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 346345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F07D771B0 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)[-1.000,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: Thu, 18 Apr 2019 05:37:19 -0000 Author: imp Date: Thu Apr 18 05:37:18 2019 New Revision: 346345 URL: https://svnweb.freebsd.org/changeset/base/346345 Log: Add a more generic efi_setenv function. efi_setenv allows any UEFI variable to be set. Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/efienv.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Thu Apr 18 02:54:07 2019 (r346344) +++ head/stand/efi/include/efilib.h Thu Apr 18 05:37:18 2019 (r346345) @@ -125,6 +125,7 @@ void cpy16to8(const CHAR16 *, char *, size_t); EFI_STATUS efi_freebsd_getenv(const char *v, void *data, __size_t *len); EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, __size_t *len); EFI_STATUS efi_global_getenv(const char *v, void *data, __size_t *len); +EFI_STATUS efi_setenv(EFI_GUID *guid, const char *varname, UINT32 attr, void *data, __size_t len); EFI_STATUS efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr); /* guids and names */ Modified: head/stand/efi/libefi/efienv.c ============================================================================== --- head/stand/efi/libefi/efienv.c Thu Apr 18 02:54:07 2019 (r346344) +++ head/stand/efi/libefi/efienv.c Thu Apr 18 05:37:18 2019 (r346345) @@ -68,6 +68,25 @@ efi_freebsd_getenv(const char *v, void *data, size_t * return (efi_getenv(&FreeBSDBootVarGUID, v, data, len)); } +/* + * efi_setenv -- Sets an env variable. + */ +EFI_STATUS +efi_setenv(EFI_GUID *guid, const char *varname, UINT32 attr, void *data, __size_t len) +{ + EFI_STATUS rv; + CHAR16 *uv; + size_t ul; + + uv = NULL; + if (utf8_to_ucs2(varname, &uv, &ul) != 0) + return (EFI_OUT_OF_RESOURCES); + + rv = RS->SetVariable(uv, guid, attr, len, data); + free(uv); + return (rv); +} + EFI_STATUS efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) { From owner-svn-src-head@freebsd.org Thu Apr 18 05:40:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB2AC15889CA; Thu, 18 Apr 2019 05:40:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 5DD4077358; Thu, 18 Apr 2019 05:40:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 395731A765; Thu, 18 Apr 2019 05:40:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3I5epgp086204; Thu, 18 Apr 2019 05:40:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3I5eo96086202; Thu, 18 Apr 2019 05:40:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904180540.x3I5eo96086202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Apr 2019 05:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346346 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 346346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DD4077358 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)[-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, 18 Apr 2019 05:40:51 -0000 Author: imp Date: Thu Apr 18 05:40:50 2019 New Revision: 346346 URL: https://svnweb.freebsd.org/changeset/base/346346 Log: Add efi_delenv Add an interface to remove / delete UEFI variables. Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/efienv.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Thu Apr 18 05:37:18 2019 (r346345) +++ head/stand/efi/include/efilib.h Thu Apr 18 05:40:50 2019 (r346346) @@ -122,6 +122,7 @@ void cpy16to8(const CHAR16 *, char *, size_t); * the loader setting / getting FreeBSD specific variables. */ +EFI_STATUS efi_delenv(EFI_GUID *guid, const char *varname); EFI_STATUS efi_freebsd_getenv(const char *v, void *data, __size_t *len); EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, __size_t *len); EFI_STATUS efi_global_getenv(const char *v, void *data, __size_t *len); Modified: head/stand/efi/libefi/efienv.c ============================================================================== --- head/stand/efi/libefi/efienv.c Thu Apr 18 05:37:18 2019 (r346345) +++ head/stand/efi/libefi/efienv.c Thu Apr 18 05:40:50 2019 (r346346) @@ -103,3 +103,21 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va return (rv); } +/* + * efi_delenv -- deletes the specified env variable + */ +EFI_STATUS +efi_delenv(EFI_GUID *guid, const char *name) +{ + CHAR16 *var; + size_t len; + EFI_STATUS rv; + + var = NULL; + if (utf8_to_ucs2(name, &var, &len) != 0) + return (EFI_OUT_OF_RESOURCES); + + rv = RS->SetVariable(var, guid, 0, 0, NULL); + free(var); + return rv; +} From owner-svn-src-head@freebsd.org Thu Apr 18 10:54:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2AC9156CEC7; Thu, 18 Apr 2019 10:54:09 +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 66F95888A2; Thu, 18 Apr 2019 10:54:09 +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 445631DDCD; Thu, 18 Apr 2019 10:54:09 +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 x3IAs9S8050891; Thu, 18 Apr 2019 10:54:09 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IAs9kF050890; Thu, 18 Apr 2019 10:54:09 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201904181054.x3IAs9kF050890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 18 Apr 2019 10:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346347 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 346347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66F95888A2 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_SHORT(-0.97)[-0.970,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)[-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, 18 Apr 2019 10:54:10 -0000 Author: kp Date: Thu Apr 18 10:54:08 2019 New Revision: 346347 URL: https://svnweb.freebsd.org/changeset/base/346347 Log: pf tests: Fail the test if we can't set the rules The test should fail if pf rules can't be set. This is helpful both while writing tests and to verify that pfctl works as expected. MFC after: 1 week Event: Aberdeen hackathon 2019 Modified: head/tests/sys/netpfil/pf/utils.subr Modified: head/tests/sys/netpfil/pf/utils.subr ============================================================================== --- head/tests/sys/netpfil/pf/utils.subr Thu Apr 18 05:40:50 2019 (r346346) +++ head/tests/sys/netpfil/pf/utils.subr Thu Apr 18 10:54:08 2019 (r346347) @@ -40,6 +40,10 @@ pft_set_rules() printf "$1\n" shift done | jexec ${jname} pfctl -f - + if [ $? -ne 0 ]; + then + atf_fail "Failed to set PF rules in ${jname}" + fi } pft_cleanup() From owner-svn-src-head@freebsd.org Thu Apr 18 11:06:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D7A156D207; Thu, 18 Apr 2019 11:06:46 +0000 (UTC) (envelope-from thj@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 9DB8188D7E; Thu, 18 Apr 2019 11:06:45 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 790391DF8D; Thu, 18 Apr 2019 11:06:45 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3IB6jWJ056326; Thu, 18 Apr 2019 11:06:45 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IB6jwb056325; Thu, 18 Apr 2019 11:06:45 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201904181106.x3IB6jwb056325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Thu, 18 Apr 2019 11:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346348 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DB8188D7E 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)[-1.000,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: Thu, 18 Apr 2019 11:06:46 -0000 Author: thj Date: Thu Apr 18 11:06:45 2019 New Revision: 346348 URL: https://svnweb.freebsd.org/changeset/base/346348 Log: Add a bugs section to pflog man page FreeBSD does not set the pid field in the pfloghdr struct. This field is populated on other platforms, document this to save people from trying to use this field. Event: Aberdeen hackathon 2019 Reviewed by: kp, bcr, bz Approved by: bz (mentor) Differential Revision: https://reviews.freebsd.org/D19952 Modified: head/share/man/man4/pflog.4 Modified: head/share/man/man4/pflog.4 ============================================================================== --- head/share/man/man4/pflog.4 Thu Apr 18 10:54:08 2019 (r346347) +++ head/share/man/man4/pflog.4 Thu Apr 18 11:06:45 2019 (r346348) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2019 +.Dd April 18, 2019 .Dt PFLOG 4 .Os .Sh NAME @@ -110,5 +110,7 @@ The .Nm device first appeared in .Ox 3.0 . -.\" .Sh BUGS -.\" Anything here? +.Sh BUGS +FreeBSD does not set a process id in the +.Fa pid +field in pfloghdr. From owner-svn-src-head@freebsd.org Thu Apr 18 11:11:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E65B7156D303; Thu, 18 Apr 2019 11:11:57 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A12389201; Thu, 18 Apr 2019 11:11:57 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 160F122089; Thu, 18 Apr 2019 07:11:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 18 Apr 2019 07:11:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm2; bh=uDC8Ge 7OwgyrTwySDanzwM6YawowEkgGv0LH5ouQukk=; b=iCSKyLOgCUDx9vdJL5Ih2B tGPUWG4vGFBlaHkjrV7bVw5KWhwc/QMAmFPXagc9QYRMYvFPRTGPQlYfmaicvJbP MjwnImHh7bAJ4/nZ75Vnpa2EFavE7+Ngvj6zdccleKUSEMpcyL18MexjCby4mKOj 05DIZU8k1YivgsdyKZBa467fB0M6/tcpwHUNfMdjSI7jJMk8zMQe2lF+HFaV2i9W G4YU+sEEcqUXgvILkPFJzw/LPGmZYNUZmcYWvVpeGoWIaqUpDJ4iSju4EvEz2piI Kc1n3jusAuEszM2RHanbjwkTUqN4g2214Wqt4Zk57uKr/LpTpIHc2/SfXdgiP7lA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrfeehgdeftdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecuogfuohhrthgvugftvggtihhpvdculdegtddmnecujf gurhepfffhvffukfhfgggtuggjfgesthdtredttdervdenucfhrhhomhepvfhomhculfho nhgvshcuoehthhhjsehfrhgvvggsshgurdhorhhgqeenucffohhmrghinhepfhhrvggvsg hsugdrohhrghenucfkphepudefjedrhedtrddujedruddvnecurfgrrhgrmhepmhgrihhl fhhrohhmpehthhhjsehfrhgvvggsshgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from tom-desk.erg.abdn.ac.uk (tom-desk.erg.abdn.ac.uk [137.50.17.12]) by mail.messagingengine.com (Postfix) with ESMTPA id D2062103C9; Thu, 18 Apr 2019 07:11:49 -0400 (EDT) Date: Thu, 18 Apr 2019 12:13:56 +0100 From: Tom Jones To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346348 - head/share/man/man4 Message-ID: <20190418111356.GC51517@tom-desk.erg.abdn.ac.uk> References: <201904181106.x3IB6jwb056325@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904181106.x3IB6jwb056325@repo.freebsd.org> User-Agent: Mutt/1.11.1 (2018-12-01) X-Rspamd-Queue-Id: 8A12389201 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.977,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, 18 Apr 2019 11:11:58 -0000 On Thu, Apr 18, 2019 at 11:06:45AM +0000, Tom Jones wrote: > Author: thj > Date: Thu Apr 18 11:06:45 2019 > New Revision: 346348 > URL: https://svnweb.freebsd.org/changeset/base/346348 > > Log: > Add a bugs section to pflog man page > > FreeBSD does not set the pid field in the pfloghdr struct. This field is > populated on other platforms, document this to save people from trying > to use this field. > > Event: Aberdeen hackathon 2019 > Reviewed by: kp, bcr, bz > Approved by: bz (mentor) > Differential Revision: https://reviews.freebsd.org/D19952 > > Modified: > head/share/man/man4/pflog.4 Should also reference https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=122773 - [tj] From owner-svn-src-head@freebsd.org Thu Apr 18 11:37:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79753156DBD9; Thu, 18 Apr 2019 11:37:45 +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 21A3589CF0; Thu, 18 Apr 2019 11:37:45 +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 F16671E4A6; Thu, 18 Apr 2019 11:37:44 +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 x3IBbiJU072233; Thu, 18 Apr 2019 11:37:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IBbivn072232; Thu, 18 Apr 2019 11:37:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201904181137.x3IBbivn072232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 18 Apr 2019 11:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346349 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 346349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21A3589CF0 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,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, 18 Apr 2019 11:37:45 -0000 Author: kp Date: Thu Apr 18 11:37:44 2019 New Revision: 346349 URL: https://svnweb.freebsd.org/changeset/base/346349 Log: pf: No need to M_NOWAIT in DIOCRSETTFLAGS Now that we don't hold a lock during DIOCRSETTFLAGS memory allocation we can use M_WAITOK. MFC after: 1 week Event: Aberdeen hackathon 2019 Pointed out by: glebius@ Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Apr 18 11:06:45 2019 (r346348) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Apr 18 11:37:44 2019 (r346349) @@ -3110,11 +3110,7 @@ DIOCCHANGEADDR_error: totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_NOWAIT); - if (pfrts == NULL) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); From owner-svn-src-head@freebsd.org Thu Apr 18 13:07:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB6CE1570CC1; Thu, 18 Apr 2019 13:07:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CB848CF08; Thu, 18 Apr 2019 13:07:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f176.google.com with SMTP id y204so3171352itf.3; Thu, 18 Apr 2019 06:07:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SyMuGg79qm8H5QiT13I+99o53mHHCjGtBjyojkCL9OU=; b=iMZlWEJA5bGFSXj84+zRzXHIBCBpvLRA075V/jMyzry117jGJp/pUKczLAYXlFskse ia4QVNdf3YVTLTFuIsMtN/0XPVS+KW0CS/Z/41vEtPoOzu+/2wPMZIzNL3xfWwtgxs7S cJWi9Ctl/6XzDq3RdreYI281R8lWvYeEkfmW0lhCUKdDa9xd6aQtv4K2AdNKQeo6OLDX /o4+fT4Z9Yp8MeNUtyPAS0ZX2jQ71Yd+oJsCemDg04QjeWwpxdfJLJ0PnOeIGPFmO4WU eu5CWIDq2vKMalh6xbj66Qz/K8lFXfV4oSn+DhywVDHwWUuhxS3HImFaTynTGWc9IF0O 7gTA== X-Gm-Message-State: APjAAAWe5ky3mzVEBoPMhdnfoxMjMf6CQfvnyKMxXj1RbKYDu2BmaRTV 83PoSAyN6cfctmSTO+STCuWKm7cEJpkS+yU/ksykEQ== X-Google-Smtp-Source: APXvYqy1Xxidf/9oJX1vMRHRSvutfhig1DqrZZRoeI1yFH7YCpH6rXFlWVo1Y+KlBj+4QZZMa1l0LL+WcvN5MPiExlc= X-Received: by 2002:a24:7354:: with SMTP id y81mr3114767itb.87.1555592871742; Thu, 18 Apr 2019 06:07:51 -0700 (PDT) MIME-Version: 1.0 References: <201904180102.x3I120ms040287@repo.freebsd.org> <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net> In-Reply-To: <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net> From: Ed Maste Date: Thu, 18 Apr 2019 09:07:39 -0400 Message-ID: Subject: Re: svn commit: r346341 - head/tools/build To: "Rodney W. Grimes" Cc: Cy Schubert , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 6CB848CF08 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.89)[-0.891,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, 18 Apr 2019 13:07:59 -0000 On Wed, 17 Apr 2019 at 21:07, Rodney W. Grimes wrote: > > Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake. It's not in fact; strings is being built for the host here, and the headers in /usr/include are the appropriate ones. In this specific case the Capsicum change needs to be made fully portable for upstreaming to the ELF Tool Chain project and when that happens it will build on FreeBSD build hosts older than r346314 the same way it will build on Linux or other hosts without an up-to-date cap_fileargs, by using a local portability wrappers. From owner-svn-src-head@freebsd.org Thu Apr 18 13:45:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E10F11571A50; Thu, 18 Apr 2019 13:45:47 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 4EAB88E5A2; Thu, 18 Apr 2019 13:45:47 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3IDjgxw005765; Thu, 18 Apr 2019 06:45:42 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3IDjgr4005764; Thu, 18 Apr 2019 06:45:42 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904181345.x3IDjgr4005764@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346341 - head/tools/build In-Reply-To: <201904180332.x3I3WJTt096491@slippy.cwsent.com> To: Cy Schubert Date: Thu, 18 Apr 2019 06:45:42 -0700 (PDT) CC: rgrimes@freebsd.org, Cy Schubert , 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: 4EAB88E5A2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,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: Thu, 18 Apr 2019 13:45:48 -0000 > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, "Rodney W. > Grimes" > writes: > > > Author: cy > > > Date: Thu Apr 18 01:02:00 2019 > > > New Revision: 346341 > > > URL: https://svnweb.freebsd.org/changeset/base/346341 > > > > > > Log: > > > As an interim measure until a more permanent solution is implemented > > > workaround the following error: > > > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of > > > undeclared identifier > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > > > > > Reported by: O. Hartmann > > > Reported by: Michael Butler > > > Reported by: gjb@ & cy@ (implicit) > > > Reviewed by: emaste@ > > > Noted by: rgrimes@ > > > > > > Modified: > > > head/tools/build/Makefile > > > > > > Modified: head/tools/build/Makefile > > > =========================================================================== > > === > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 (r34634 > > 0) > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 (r34634 > > 1) > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > > > INCS+= libcasper.h > > > .endif > > > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea > > rgs.h > > > -.endif > > > > As a further note, we should probably hunt for any thing > > that is explicity looking at /usr/include/... in a Makefile, > > as that is minimally missing a ${DESTDIR} argument. > > > > The above may of actually worked if it had been written: > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > > someone may wish to test that. > > > > Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake. > > This is a better solution. I tested this in a tree with a duplicated > environment: Problem solved. Before this is committed it should be > tested on one of the universe machines. >From what Ed just said this would also be wrong, as well as CASPERINC+= above being wrong, if this is being built for the host we should not be using any headers from ${SRCTOP} at all. if capfileargs.h does not exist on the host that functionality must not be compiled into the buildtool as the host does not have this feature and attempting to use it from SRCTOP is wrong. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 18 14:02:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8FD1572018; Thu, 18 Apr 2019 14:02:34 +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 5DE7E8EFF6; Thu, 18 Apr 2019 14:02:34 +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 309AA1FF15; Thu, 18 Apr 2019 14:02:34 +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 x3IE2XxS052367; Thu, 18 Apr 2019 14:02:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IE2X5O052366; Thu, 18 Apr 2019 14:02:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904181402.x3IE2X5O052366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Apr 2019 14:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346350 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 346350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DE7E8EFF6 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)[-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, 18 Apr 2019 14:02:34 -0000 Author: kib Date: Thu Apr 18 14:02:33 2019 New Revision: 346350 URL: https://svnweb.freebsd.org/changeset/base/346350 Log: Reduce verbosity, do not announce details of irte programming by default. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/x86/iommu/intel_intrmap.c Modified: head/sys/x86/iommu/intel_intrmap.c ============================================================================== --- head/sys/x86/iommu/intel_intrmap.c Thu Apr 18 11:37:44 2019 (r346349) +++ head/sys/x86/iommu/intel_intrmap.c Thu Apr 18 14:02:33 2019 (r346350) @@ -270,9 +270,11 @@ dmar_ir_program_irte(struct dmar_unit *unit, u_int idx irte = &(unit->irt[idx]); high = DMAR_IRTE2_SVT_RID | DMAR_IRTE2_SQ_RID | DMAR_IRTE2_SID_RID(rid); - device_printf(unit->dev, - "programming irte[%d] rid %#x high %#jx low %#jx\n", - idx, rid, (uintmax_t)high, (uintmax_t)low); + if (bootverbose) { + device_printf(unit->dev, + "programming irte[%d] rid %#x high %#jx low %#jx\n", + idx, rid, (uintmax_t)high, (uintmax_t)low); + } DMAR_LOCK(unit); if ((irte->irte1 & DMAR_IRTE1_P) != 0) { /* From owner-svn-src-head@freebsd.org Thu Apr 18 14:02:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A19157204B; Thu, 18 Apr 2019 14:02:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCE198F128; Thu, 18 Apr 2019 14:02:56 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 8207F7D69; Thu, 18 Apr 2019 14:02:56 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f47.google.com with SMTP id h5so1741013lfm.1; Thu, 18 Apr 2019 07:02:56 -0700 (PDT) X-Gm-Message-State: APjAAAWXUHSB862ZfLA2xA4wFSU7BjpgAovcDZr7Rd0d2Je24tkms5tb 3bgP0CUnJ1jEkrqdlgmuj5+rrbFMwq38fZJPTAU= X-Google-Smtp-Source: APXvYqzN62Da37ZCQ7QaMElYLnMau/oz8UOZx6Y1So0gGfZw+zj1RGV2rwwqwZseftqMDoBEDiW8x+OS/flz2V7Wud8= X-Received: by 2002:a19:7005:: with SMTP id h5mr26965406lfc.143.1555596175019; Thu, 18 Apr 2019 07:02:55 -0700 (PDT) MIME-Version: 1.0 References: <201904180332.x3I3WJTt096491@slippy.cwsent.com> <201904181345.x3IDjgr4005764@gndrsh.dnsmgr.net> In-Reply-To: <201904181345.x3IDjgr4005764@gndrsh.dnsmgr.net> From: Kyle Evans Date: Thu, 18 Apr 2019 09:02:42 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346341 - head/tools/build To: "Rodney W. Grimes" Cc: Cy Schubert , Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: DCE198F128 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.945,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: Thu, 18 Apr 2019 14:02:57 -0000 On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes wrote: > > > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, "Rodney W. > > Grimes" > > writes: > > > > Author: cy > > > > Date: Thu Apr 18 01:02:00 2019 > > > > New Revision: 346341 > > > > URL: https://svnweb.freebsd.org/changeset/base/346341 > > > > > > > > Log: > > > > As an interim measure until a more permanent solution is implemented > > > > workaround the following error: > > > > > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of > > > > undeclared identifier > > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > > > > > > > Reported by: O. Hartmann > > > > Reported by: Michael Butler > > > > Reported by: gjb@ & cy@ (implicit) > > > > Reviewed by: emaste@ > > > > Noted by: rgrimes@ > > > > > > > > Modified: > > > > head/tools/build/Makefile > > > > > > > > Modified: head/tools/build/Makefile > > > > =========================================================================== > > > === > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 (r34634 > > > 0) > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 (r34634 > > > 1) > > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > > > > INCS+= libcasper.h > > > > .endif > > > > > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea > > > rgs.h > > > > -.endif > > > > > > As a further note, we should probably hunt for any thing > > > that is explicity looking at /usr/include/... in a Makefile, > > > as that is minimally missing a ${DESTDIR} argument. > > > > > > The above may of actually worked if it had been written: > > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > > > someone may wish to test that. > > > > > > Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake. > > > > This is a better solution. I tested this in a tree with a duplicated > > environment: Problem solved. Before this is committed it should be > > tested on one of the universe machines. > > From what Ed just said this would also be wrong, > as well as CASPERINC+= above being wrong, if this > is being built for the host we should not be using > any headers from ${SRCTOP} at all. > > if capfileargs.h does not exist on the host that functionality > must not be compiled into the buildtool as the host does not > have this feature and attempting to use it from SRCTOP is wrong. > Keep in mind that this is bootstrap; it's being built for the host system, but it will link against a version of libcasper that's been built in an earlier stage with the proper featureset. From owner-svn-src-head@freebsd.org Thu Apr 18 14:04:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA531572111; Thu, 18 Apr 2019 14:04:00 +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 256C58F29F; Thu, 18 Apr 2019 14:04:00 +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 015F51FF23; Thu, 18 Apr 2019 14:04:00 +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 x3IE3xtp052478; Thu, 18 Apr 2019 14:03:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IE3xJ3052477; Thu, 18 Apr 2019 14:03:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904181403.x3IE3xJ3052477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Apr 2019 14:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346351 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 346351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 256C58F29F 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)[-1.000,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: Thu, 18 Apr 2019 14:04:00 -0000 Author: kib Date: Thu Apr 18 14:03:59 2019 New Revision: 346351 URL: https://svnweb.freebsd.org/changeset/base/346351 Log: Remove witness warning. dmar_bus_dmamap_create() does not sleep. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Thu Apr 18 14:02:33 2019 (r346350) +++ head/sys/x86/iommu/busdma_dmar.c Thu Apr 18 14:03:59 2019 (r346351) @@ -371,8 +371,6 @@ dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, struct bus_dma_tag_dmar *tag; struct bus_dmamap_dmar *map; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - tag = (struct bus_dma_tag_dmar *)dmat; map = malloc_domainset(sizeof(*map), M_DMAR_DMAMAP, DOMAINSET_PREF(tag->common.domain), M_NOWAIT | M_ZERO); From owner-svn-src-head@freebsd.org Thu Apr 18 14:18:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96825157282B; Thu, 18 Apr 2019 14:18:08 +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 462538FBEE; Thu, 18 Apr 2019 14:18:08 +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 21E87200FD; Thu, 18 Apr 2019 14:18:08 +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 x3IEI8oh057969; Thu, 18 Apr 2019 14:18:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IEI7E5057963; Thu, 18 Apr 2019 14:18:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904181418.x3IEI7E5057963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Apr 2019 14:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346352 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 346352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 462538FBEE 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.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 18 Apr 2019 14:18:09 -0000 Author: kib Date: Thu Apr 18 14:18:06 2019 New Revision: 346352 URL: https://svnweb.freebsd.org/changeset/base/346352 Log: Correct handling of RMRR during early enumeration stages. On some machines, DMAR contexts must be created before all devices under the scope of the corresponding DMAR unit are enumerated. Current code has two problems with that: - scope lookup returns NULL device_t, which causes to skip creating a context with RMRR, which is fatal for the affected device. - calculation of the final pci dbsf address fails if any bridge in the scope is not yet enumerated, because code relies on pcib_get_bus(). Make creation of contexts work either with device_t, or with DMAR PCI scope paths. Scope provides enough information to infer context address, and it is directly matched against DMAR tables scopes. When calculating bus addresses for the scope or device, use direct pci_cfgregread(PCIR_SECBUS_1) to get the secondary bus number, instead of pcib_get_bus(). The issue was observed on HP Gen servers, where iLO PCI devices are located behind south bridge switch. Turning on translation without satisfying RMRR requests caused iLO to mostly hang, up to the level of being unusable to control the server. While there, remove hw.dmar.dmar_match_verbose tunable, and make the normal logging under bootverbose useful and sufficient to diagnose DRHD and RMRR parsing and matching. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_intrmap.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Thu Apr 18 14:03:59 2019 (r346351) +++ head/sys/x86/iommu/busdma_dmar.c Thu Apr 18 14:18:06 2019 (r346352) @@ -275,7 +275,7 @@ dmar_get_dma_tag(device_t dev, device_t child) struct dmar_ctx *ctx; bus_dma_tag_t res; - dmar = dmar_find(child); + dmar = dmar_find(child, bootverbose); /* Not in scope of any DMAR ? */ if (dmar == NULL) return (NULL); Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Thu Apr 18 14:03:59 2019 (r346351) +++ head/sys/x86/iommu/intel_ctx.c Thu Apr 18 14:18:06 2019 (r346352) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -203,7 +205,9 @@ dmar_flush_for_ctx_entry(struct dmar_unit *dmar, bool } static int -domain_init_rmrr(struct dmar_domain *domain, device_t dev) +domain_init_rmrr(struct dmar_domain *domain, device_t dev, int bus, + int slot, int func, int dev_domain, int dev_busno, + const void *dev_path, int dev_path_len) { struct dmar_map_entries_tailq rmrr_entries; struct dmar_map_entry *entry, *entry1; @@ -214,7 +218,8 @@ domain_init_rmrr(struct dmar_domain *domain, device_t error = 0; TAILQ_INIT(&rmrr_entries); - dmar_dev_parse_rmrr(domain, dev, &rmrr_entries); + dmar_dev_parse_rmrr(domain, dev_domain, dev_busno, dev_path, + dev_path_len, &rmrr_entries); TAILQ_FOREACH_SAFE(entry, &rmrr_entries, unroll_link, entry1) { /* * VT-d specification requires that the start of an @@ -227,12 +232,19 @@ domain_init_rmrr(struct dmar_domain *domain, device_t */ start = entry->start; end = entry->end; + if (bootverbose) + printf("dmar%d ctx pci%d:%d:%d RMRR [%#jx, %#jx]\n", + domain->dmar->unit, bus, slot, func, + (uintmax_t)start, (uintmax_t)end); entry->start = trunc_page(start); entry->end = round_page(end); if (entry->start == entry->end) { /* Workaround for some AMI (?) BIOSes */ if (bootverbose) { - device_printf(dev, "BIOS bug: dmar%d RMRR " + if (dev != NULL) + device_printf(dev, ""); + printf("pci%d:%d:%d ", bus, slot, func); + printf("BIOS bug: dmar%d RMRR " "region (%jx, %jx) corrected\n", domain->dmar->unit, start, end); } @@ -260,9 +272,13 @@ domain_init_rmrr(struct dmar_domain *domain, device_t DMAR_UNLOCK(domain->dmar); } else { if (error1 != 0) { - device_printf(dev, + if (dev != NULL) + device_printf(dev, ""); + printf("pci%d:%d:%d ", bus, slot, func); + printf( "dmar%d failed to map RMRR region (%jx, %jx) %d\n", - domain->dmar->unit, start, end, error1); + domain->dmar->unit, start, end, + error1); error = error1; } TAILQ_REMOVE(&rmrr_entries, entry, unroll_link); @@ -404,8 +420,9 @@ dmar_domain_destroy(struct dmar_domain *domain) free(domain, M_DMAR_DOMAIN); } -struct dmar_ctx * -dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t dev, uint16_t rid, +static struct dmar_ctx * +dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t dev, uint16_t rid, + int dev_domain, int dev_busno, const void *dev_path, int dev_path_len, bool id_mapped, bool rmrr_init) { struct dmar_domain *domain, *domain1; @@ -415,9 +432,15 @@ dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t int bus, slot, func, error; bool enable; - bus = pci_get_bus(dev); - slot = pci_get_slot(dev); - func = pci_get_function(dev); + if (dev != NULL) { + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + } else { + bus = PCI_RID2BUS(rid); + slot = PCI_RID2SLOT(rid); + func = PCI_RID2FUNC(rid); + } enable = false; TD_PREP_PINNED_ASSERT; DMAR_LOCK(dmar); @@ -436,7 +459,9 @@ dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t return (NULL); } if (!id_mapped) { - error = domain_init_rmrr(domain1, dev); + error = domain_init_rmrr(domain1, dev, bus, + slot, func, dev_domain, dev_busno, dev_path, + dev_path_len); if (error != 0) { dmar_domain_destroy(domain1); TD_PINNED_ASSERT; @@ -468,12 +493,14 @@ dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t enable = true; LIST_INSERT_HEAD(&dmar->domains, domain, link); ctx_id_entry_init(ctx, ctxp, false); - device_printf(dev, + if (dev != NULL) { + device_printf(dev, "dmar%d pci%d:%d:%d:%d rid %x domain %d mgaw %d " - "agaw %d %s-mapped\n", - dmar->unit, dmar->segment, bus, slot, - func, rid, domain->domain, domain->mgaw, - domain->agaw, id_mapped ? "id" : "re"); + "agaw %d %s-mapped\n", + dmar->unit, dmar->segment, bus, slot, + func, rid, domain->domain, domain->mgaw, + domain->agaw, id_mapped ? "id" : "re"); + } dmar_unmap_pgtbl(sf); } else { dmar_unmap_pgtbl(sf); @@ -485,6 +512,8 @@ dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t } } else { domain = ctx->domain; + if (ctx->ctx_tag.owner == NULL) + ctx->ctx_tag.owner = dev; ctx->refs++; /* tag referenced us */ } @@ -502,7 +531,14 @@ dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t */ if (enable && !rmrr_init && (dmar->hw_gcmd & DMAR_GCMD_TE) == 0) { error = dmar_enable_translation(dmar); - if (error != 0) { + if (error == 0) { + if (bootverbose) { + printf("dmar%d: enabled translation\n", + dmar->unit); + } + } else { + printf("dmar%d: enabling translation failed, " + "error %d\n", dmar->unit, error); dmar_free_ctx_locked(dmar, ctx); TD_PINNED_ASSERT; return (NULL); @@ -511,6 +547,31 @@ dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t DMAR_UNLOCK(dmar); TD_PINNED_ASSERT; return (ctx); +} + +struct dmar_ctx * +dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t dev, uint16_t rid, + bool id_mapped, bool rmrr_init) +{ + int dev_domain, dev_path_len, dev_busno; + + dev_domain = pci_get_domain(dev); + dev_path_len = dmar_dev_depth(dev); + ACPI_DMAR_PCI_PATH dev_path[dev_path_len]; + dmar_dev_path(dev, &dev_busno, dev_path, dev_path_len); + return (dmar_get_ctx_for_dev1(dmar, dev, rid, dev_domain, dev_busno, + dev_path, dev_path_len, id_mapped, rmrr_init)); +} + +struct dmar_ctx * +dmar_get_ctx_for_devpath(struct dmar_unit *dmar, uint16_t rid, + int dev_domain, int dev_busno, + const void *dev_path, int dev_path_len, + bool id_mapped, bool rmrr_init) +{ + + return (dmar_get_ctx_for_dev1(dmar, NULL, rid, dev_domain, dev_busno, + dev_path, dev_path_len, id_mapped, rmrr_init)); } int Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Thu Apr 18 14:03:59 2019 (r346351) +++ head/sys/x86/iommu/intel_dmar.h Thu Apr 18 14:18:06 2019 (r346352) @@ -258,7 +258,7 @@ struct dmar_unit { #define DMAR_BARRIER_RMRR 0 #define DMAR_BARRIER_USEQ 1 -struct dmar_unit *dmar_find(device_t dev); +struct dmar_unit *dmar_find(device_t dev, bool verbose); struct dmar_unit *dmar_find_hpet(device_t dev, uint16_t *rid); struct dmar_unit *dmar_find_ioapic(u_int apic_id, uint16_t *rid); @@ -325,10 +325,16 @@ void domain_flush_iotlb_sync(struct dmar_domain *domai int domain_alloc_pgtbl(struct dmar_domain *domain); void domain_free_pgtbl(struct dmar_domain *domain); +int dmar_dev_depth(device_t child); +void dmar_dev_path(device_t child, int *busno, void *path1, int depth); + struct dmar_ctx *dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr); struct dmar_ctx *dmar_get_ctx_for_dev(struct dmar_unit *dmar, device_t dev, uint16_t rid, bool id_mapped, bool rmrr_init); +struct dmar_ctx *dmar_get_ctx_for_devpath(struct dmar_unit *dmar, uint16_t rid, + int dev_domain, int dev_busno, const void *dev_path, int dev_path_len, + bool id_mapped, bool rmrr_init); int dmar_move_ctx_to_domain(struct dmar_domain *domain, struct dmar_ctx *ctx); void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); void dmar_free_ctx(struct dmar_ctx *ctx); @@ -360,7 +366,8 @@ int dmar_gas_map_region(struct dmar_domain *domain, int dmar_gas_reserve_region(struct dmar_domain *domain, dmar_gaddr_t start, dmar_gaddr_t end); -void dmar_dev_parse_rmrr(struct dmar_domain *domain, device_t dev, +void dmar_dev_parse_rmrr(struct dmar_domain *domain, int dev_domain, + int dev_busno, const void *dev_path, int dev_path_len, struct dmar_map_entries_tailq *rmrr_entries); int dmar_instantiate_rmrr_ctxs(struct dmar_unit *dmar); @@ -382,7 +389,6 @@ void dmar_fini_irt(struct dmar_unit *unit); extern dmar_haddr_t dmar_high; extern int haw; extern int dmar_tbl_pagecnt; -extern int dmar_match_verbose; extern int dmar_batch_coalesce; extern int dmar_check_free; Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Thu Apr 18 14:03:59 2019 (r346351) +++ head/sys/x86/iommu/intel_drv.c Thu Apr 18 14:18:06 2019 (r346352) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -176,7 +177,6 @@ dmar_identify(driver_t *driver, device_t parent) #ifdef INVARIANTS TUNABLE_INT_FETCH("hw.dmar.check_free", &dmar_check_free); #endif - TUNABLE_INT_FETCH("hw.dmar.match_verbose", &dmar_match_verbose); status = AcpiGetTable(ACPI_SIG_DMAR, 1, (ACPI_TABLE_HEADER **)&dmartbl); if (ACPI_FAILURE(status)) return; @@ -595,21 +595,20 @@ DRIVER_MODULE(dmar, acpi, dmar_driver, dmar_devclass, MODULE_DEPEND(dmar, acpi, 1, 1, 1); static void -dmar_print_path(device_t dev, const char *banner, int busno, int depth, - const ACPI_DMAR_PCI_PATH *path) +dmar_print_path(int busno, int depth, const ACPI_DMAR_PCI_PATH *path) { int i; - device_printf(dev, "%s [%d, ", banner, busno); + printf("[%d, ", busno); for (i = 0; i < depth; i++) { if (i != 0) printf(", "); printf("(%d, %d)", path[i].Device, path[i].Function); } - printf("]\n"); + printf("]"); } -static int +int dmar_dev_depth(device_t child) { devclass_t pci_class; @@ -627,13 +626,15 @@ dmar_dev_depth(device_t child) } } -static void -dmar_dev_path(device_t child, int *busno, ACPI_DMAR_PCI_PATH *path, int depth) +void +dmar_dev_path(device_t child, int *busno, void *path1, int depth) { devclass_t pci_class; device_t bus, pcib; + ACPI_DMAR_PCI_PATH *path; pci_class = devclass_find("pci"); + path = path1; for (depth--; depth != -1; depth--) { path[depth].Device = pci_get_slot(child); path[depth].Function = pci_get_function(child); @@ -673,14 +674,14 @@ dmar_match_pathes(int busno1, const ACPI_DMAR_PCI_PATH } static int -dmar_match_devscope(ACPI_DMAR_DEVICE_SCOPE *devscope, device_t dev, - int dev_busno, const ACPI_DMAR_PCI_PATH *dev_path, int dev_path_len) +dmar_match_devscope(ACPI_DMAR_DEVICE_SCOPE *devscope, int dev_busno, + const ACPI_DMAR_PCI_PATH *dev_path, int dev_path_len) { ACPI_DMAR_PCI_PATH *path; int path_len; if (devscope->Length < sizeof(*devscope)) { - printf("dmar_find: corrupted DMAR table, dl %d\n", + printf("dmar_match_devscope: corrupted DMAR table, dl %d\n", devscope->Length); return (-1); } @@ -689,99 +690,112 @@ dmar_match_devscope(ACPI_DMAR_DEVICE_SCOPE *devscope, return (0); path_len = devscope->Length - sizeof(*devscope); if (path_len % 2 != 0) { - printf("dmar_find_bsf: corrupted DMAR table, dl %d\n", + printf("dmar_match_devscope: corrupted DMAR table, dl %d\n", devscope->Length); return (-1); } path_len /= 2; path = (ACPI_DMAR_PCI_PATH *)(devscope + 1); if (path_len == 0) { - printf("dmar_find: corrupted DMAR table, dl %d\n", + printf("dmar_match_devscope: corrupted DMAR table, dl %d\n", devscope->Length); return (-1); } - if (dmar_match_verbose) - dmar_print_path(dev, "DMAR", devscope->Bus, path_len, path); return (dmar_match_pathes(devscope->Bus, path, path_len, dev_busno, dev_path, dev_path_len, devscope->EntryType)); } -struct dmar_unit * -dmar_find(device_t dev) +static bool +dmar_match_by_path(struct dmar_unit *unit, int dev_domain, int dev_busno, + const ACPI_DMAR_PCI_PATH *dev_path, int dev_path_len, const char **banner) { - device_t dmar_dev; ACPI_DMAR_HARDWARE_UNIT *dmarh; ACPI_DMAR_DEVICE_SCOPE *devscope; char *ptr, *ptrend; - int i, match, dev_domain, dev_busno, dev_path_len; + int match; + dmarh = dmar_find_by_index(unit->unit); + if (dmarh == NULL) + return (false); + if (dmarh->Segment != dev_domain) + return (false); + if ((dmarh->Flags & ACPI_DMAR_INCLUDE_ALL) != 0) { + if (banner != NULL) + *banner = "INCLUDE_ALL"; + return (true); + } + ptr = (char *)dmarh + sizeof(*dmarh); + ptrend = (char *)dmarh + dmarh->Header.Length; + while (ptr < ptrend) { + devscope = (ACPI_DMAR_DEVICE_SCOPE *)ptr; + ptr += devscope->Length; + match = dmar_match_devscope(devscope, dev_busno, dev_path, + dev_path_len); + if (match == -1) + return (false); + if (match == 1) { + if (banner != NULL) + *banner = "specific match"; + return (true); + } + } + return (false); +} + +static struct dmar_unit * +dmar_find_by_scope(int dev_domain, int dev_busno, + const ACPI_DMAR_PCI_PATH *dev_path, int dev_path_len) +{ + struct dmar_unit *unit; + int i; + + for (i = 0; i < dmar_devcnt; i++) { + if (dmar_devs[i] == NULL) + continue; + unit = device_get_softc(dmar_devs[i]); + if (dmar_match_by_path(unit, dev_domain, dev_busno, dev_path, + dev_path_len, NULL)) + return (unit); + } + return (NULL); +} + +struct dmar_unit * +dmar_find(device_t dev, bool verbose) +{ + device_t dmar_dev; + struct dmar_unit *unit; + const char *banner; + int i, dev_domain, dev_busno, dev_path_len; + dmar_dev = NULL; dev_domain = pci_get_domain(dev); dev_path_len = dmar_dev_depth(dev); ACPI_DMAR_PCI_PATH dev_path[dev_path_len]; dmar_dev_path(dev, &dev_busno, dev_path, dev_path_len); - if (dmar_match_verbose) - dmar_print_path(dev, "PCI", dev_busno, dev_path_len, dev_path); + banner = ""; for (i = 0; i < dmar_devcnt; i++) { if (dmar_devs[i] == NULL) continue; - dmarh = dmar_find_by_index(i); - if (dmarh == NULL) - continue; - if (dmarh->Segment != dev_domain) - continue; - if ((dmarh->Flags & ACPI_DMAR_INCLUDE_ALL) != 0) { - dmar_dev = dmar_devs[i]; - if (dmar_match_verbose) { - device_printf(dev, - "pci%d:%d:%d:%d matched dmar%d INCLUDE_ALL\n", - dev_domain, pci_get_bus(dev), - pci_get_slot(dev), - pci_get_function(dev), - ((struct dmar_unit *)device_get_softc( - dmar_dev))->unit); - } - goto found; - } - ptr = (char *)dmarh + sizeof(*dmarh); - ptrend = (char *)dmarh + dmarh->Header.Length; - for (;;) { - if (ptr >= ptrend) - break; - devscope = (ACPI_DMAR_DEVICE_SCOPE *)ptr; - ptr += devscope->Length; - if (dmar_match_verbose) { - device_printf(dev, - "pci%d:%d:%d:%d matching dmar%d\n", - dev_domain, pci_get_bus(dev), - pci_get_slot(dev), - pci_get_function(dev), - ((struct dmar_unit *)device_get_softc( - dmar_devs[i]))->unit); - } - match = dmar_match_devscope(devscope, dev, dev_busno, - dev_path, dev_path_len); - if (dmar_match_verbose) { - if (match == -1) - printf("table error\n"); - else if (match == 0) - printf("not matched\n"); - else - printf("matched\n"); - } - if (match == -1) - return (NULL); - else if (match == 1) { - dmar_dev = dmar_devs[i]; - goto found; - } - } + unit = device_get_softc(dmar_devs[i]); + if (dmar_match_by_path(unit, dev_domain, dev_busno, + dev_path, dev_path_len, &banner)) + break; } - return (NULL); -found: - return (device_get_softc(dmar_dev)); + if (i == dmar_devcnt) + return (NULL); + + if (verbose) { + device_printf(dev, "pci%d:%d:%d:%d matched dmar%d by %s", + dev_domain, pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev), unit->unit, banner); + printf(" scope path "); + dmar_print_path(dev_busno, dev_path_len, dev_path); + printf("\n"); + } + return (unit); } static struct dmar_unit * @@ -865,10 +879,9 @@ dmar_find_ioapic(u_int apic_id, uint16_t *rid) struct rmrr_iter_args { struct dmar_domain *domain; - device_t dev; int dev_domain; int dev_busno; - ACPI_DMAR_PCI_PATH *dev_path; + const ACPI_DMAR_PCI_PATH *dev_path; int dev_path_len; struct dmar_map_entries_tailq *rmrr_entries; }; @@ -888,12 +901,6 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) ria = arg; resmem = (ACPI_DMAR_RESERVED_MEMORY *)dmarh; - if (dmar_match_verbose) { - printf("RMRR [%jx,%jx] segment %d\n", - (uintmax_t)resmem->BaseAddress, - (uintmax_t)resmem->EndAddress, - resmem->Segment); - } if (resmem->Segment != ria->dev_domain) return (1); @@ -904,11 +911,9 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) break; devscope = (ACPI_DMAR_DEVICE_SCOPE *)ptr; ptr += devscope->Length; - match = dmar_match_devscope(devscope, ria->dev, ria->dev_busno, + match = dmar_match_devscope(devscope, ria->dev_busno, ria->dev_path, ria->dev_path_len); if (match == 1) { - if (dmar_match_verbose) - printf("matched\n"); entry = dmar_gas_alloc_entry(ria->domain, DMAR_PGF_WAITOK); entry->start = resmem->BaseAddress; @@ -916,8 +921,6 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) entry->end = resmem->EndAddress; TAILQ_INSERT_TAIL(ria->rmrr_entries, entry, unroll_link); - } else if (dmar_match_verbose) { - printf("not matched, err %d\n", match); } } @@ -925,25 +928,17 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) } void -dmar_dev_parse_rmrr(struct dmar_domain *domain, device_t dev, +dmar_dev_parse_rmrr(struct dmar_domain *domain, int dev_domain, int dev_busno, + const void *dev_path, int dev_path_len, struct dmar_map_entries_tailq *rmrr_entries) { struct rmrr_iter_args ria; - ria.dev_domain = pci_get_domain(dev); - ria.dev_path_len = dmar_dev_depth(dev); - ACPI_DMAR_PCI_PATH dev_path[ria.dev_path_len]; - dmar_dev_path(dev, &ria.dev_busno, dev_path, ria.dev_path_len); - - if (dmar_match_verbose) { - device_printf(dev, "parsing RMRR entries for "); - dmar_print_path(dev, "PCI", ria.dev_busno, ria.dev_path_len, - dev_path); - } - ria.domain = domain; - ria.dev = dev; - ria.dev_path = dev_path; + ria.dev_domain = dev_domain; + ria.dev_busno = dev_busno; + ria.dev_path = (const ACPI_DMAR_PCI_PATH *)dev_path; + ria.dev_path_len = dev_path_len; ria.rmrr_entries = rmrr_entries; dmar_iterate_tbl(dmar_rmrr_iter, &ria); } @@ -954,28 +949,22 @@ struct inst_rmrr_iter_args { static device_t dmar_path_dev(int segment, int path_len, int busno, - const ACPI_DMAR_PCI_PATH *path) + const ACPI_DMAR_PCI_PATH *path, uint16_t *rid) { - devclass_t pci_class; - device_t bus, pcib, dev; + device_t dev; int i; - pci_class = devclass_find("pci"); dev = NULL; - for (i = 0; i < path_len; i++, path++) { + for (i = 0; i < path_len; i++) { dev = pci_find_dbsf(segment, busno, path->Device, path->Function); - if (dev == NULL) - break; if (i != path_len - 1) { - bus = device_get_parent(dev); - pcib = device_get_parent(bus); - if (device_get_devclass(device_get_parent(pcib)) != - pci_class) - return (NULL); + busno = pci_cfgregread(busno, path->Device, + path->Function, PCIR_SECBUS_1, 1); + path++; } - busno = pcib_get_bus(dev); } + *rid = PCI_RID(busno, path->Device, path->Function); return (dev); } @@ -986,21 +975,19 @@ dmar_inst_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg const ACPI_DMAR_DEVICE_SCOPE *devscope; struct inst_rmrr_iter_args *iria; const char *ptr, *ptrend; - struct dmar_unit *dev_dmar; device_t dev; + struct dmar_unit *unit; + int dev_path_len; + uint16_t rid; + iria = arg; + if (dmarh->Type != ACPI_DMAR_TYPE_RESERVED_MEMORY) return (1); - iria = arg; resmem = (ACPI_DMAR_RESERVED_MEMORY *)dmarh; if (resmem->Segment != iria->dmar->segment) return (1); - if (dmar_match_verbose) { - printf("dmar%d: RMRR [%jx,%jx]\n", iria->dmar->unit, - (uintmax_t)resmem->BaseAddress, - (uintmax_t)resmem->EndAddress); - } ptr = (const char *)resmem + sizeof(*resmem); ptrend = (const char *)resmem + resmem->Header.Length; @@ -1012,31 +999,40 @@ dmar_inst_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg /* XXXKIB bridge */ if (devscope->EntryType != ACPI_DMAR_SCOPE_TYPE_ENDPOINT) continue; - if (dmar_match_verbose) { - dmar_print_path(iria->dmar->dev, "RMRR scope", - devscope->Bus, (devscope->Length - - sizeof(ACPI_DMAR_DEVICE_SCOPE)) / 2, - (const ACPI_DMAR_PCI_PATH *)(devscope + 1)); - } - dev = dmar_path_dev(resmem->Segment, (devscope->Length - - sizeof(ACPI_DMAR_DEVICE_SCOPE)) / 2, devscope->Bus, - (const ACPI_DMAR_PCI_PATH *)(devscope + 1)); + rid = 0; + dev_path_len = (devscope->Length - + sizeof(ACPI_DMAR_DEVICE_SCOPE)) / 2; + dev = dmar_path_dev(resmem->Segment, dev_path_len, + devscope->Bus, + (const ACPI_DMAR_PCI_PATH *)(devscope + 1), &rid); if (dev == NULL) { - if (dmar_match_verbose) - printf("null dev\n"); - continue; - } - dev_dmar = dmar_find(dev); - if (dev_dmar != iria->dmar) { - if (dmar_match_verbose) { - printf("dmar%d matched, skipping\n", - dev_dmar->unit); + if (bootverbose) { + printf("dmar%d no dev found for RMRR " + "[%#jx, %#jx] rid %#x scope path ", + iria->dmar->unit, + (uintptr_t)resmem->BaseAddress, + (uintptr_t)resmem->EndAddress, + rid); + dmar_print_path(devscope->Bus, dev_path_len, + (const ACPI_DMAR_PCI_PATH *)(devscope + 1)); + printf("\n"); } - continue; + unit = dmar_find_by_scope(resmem->Segment, + devscope->Bus, + (const ACPI_DMAR_PCI_PATH *)(devscope + 1), + dev_path_len); + if (iria->dmar != unit) + continue; + dmar_get_ctx_for_devpath(iria->dmar, rid, + resmem->Segment, devscope->Bus, + (const ACPI_DMAR_PCI_PATH *)(devscope + 1), + dev_path_len, false, true); + } else { + unit = dmar_find(dev, false); + if (iria->dmar != unit) + continue; + dmar_instantiate_ctx(iria->dmar, dev, true); } - if (dmar_match_verbose) - printf("matched, instantiating RMRR context\n"); - dmar_instantiate_ctx(iria->dmar, dev, true); } return (1); @@ -1057,8 +1053,6 @@ dmar_instantiate_rmrr_ctxs(struct dmar_unit *dmar) error = 0; iria.dmar = dmar; - if (dmar_match_verbose) - printf("dmar%d: instantiating RMRR contexts\n", dmar->unit); dmar_iterate_tbl(dmar_inst_rmrr_iter, &iria); DMAR_LOCK(dmar); if (!LIST_EMPTY(&dmar->domains)) { @@ -1066,6 +1060,15 @@ dmar_instantiate_rmrr_ctxs(struct dmar_unit *dmar) ("dmar%d: RMRR not handled but translation is already enabled", dmar->unit)); error = dmar_enable_translation(dmar); + if (bootverbose) { + if (error == 0) { + printf("dmar%d: enabled translation\n", + dmar->unit); + } else { + printf("dmar%d: enabling translation failed, " + "error %d\n", dmar->unit, error); + } + } } dmar_barrier_exit(dmar, DMAR_BARRIER_RMRR); return (error); Modified: head/sys/x86/iommu/intel_intrmap.c ============================================================================== --- head/sys/x86/iommu/intel_intrmap.c Thu Apr 18 14:03:59 2019 (r346351) +++ head/sys/x86/iommu/intel_intrmap.c Thu Apr 18 14:18:06 2019 (r346352) @@ -251,7 +251,7 @@ dmar_ir_find(device_t src, uint16_t *rid, int *is_dmar } else if (src_class == devclass_find("hpet")) { unit = dmar_find_hpet(src, rid); } else { - unit = dmar_find(src); + unit = dmar_find(src, bootverbose); if (unit != NULL && rid != NULL) dmar_get_requester(src, rid); } Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Thu Apr 18 14:03:59 2019 (r346351) +++ head/sys/x86/iommu/intel_utils.c Thu Apr 18 14:18:06 2019 (r346352) @@ -614,7 +614,6 @@ dmar_barrier_exit(struct dmar_unit *dmar, u_int barrie DMAR_UNLOCK(dmar); } -int dmar_match_verbose; int dmar_batch_coalesce = 100; struct timespec dmar_hw_timeout = { .tv_sec = 0, @@ -658,9 +657,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD, NU SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, &dmar_tbl_pagecnt, 0, "Count of pages used for DMAR pagetables"); -SYSCTL_INT(_hw_dmar, OID_AUTO, match_verbose, CTLFLAG_RWTUN, - &dmar_match_verbose, 0, - "Verbose matching of the PCI devices to DMAR paths"); SYSCTL_INT(_hw_dmar, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, &dmar_batch_coalesce, 0, "Number of qi batches between interrupt"); From owner-svn-src-head@freebsd.org Thu Apr 18 14:22:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D99451572BB1; Thu, 18 Apr 2019 14:22:55 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 623D5680F6; Thu, 18 Apr 2019 14:22:55 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3IEMrIi005931; Thu, 18 Apr 2019 07:22:53 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3IEMrux005930; Thu, 18 Apr 2019 07:22:53 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346341 - head/tools/build In-Reply-To: To: Kyle Evans Date: Thu, 18 Apr 2019 07:22:53 -0700 (PDT) CC: "Rodney W. Grimes" , Cy Schubert , Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 623D5680F6 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.97)[-0.965,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: Thu, 18 Apr 2019 14:22:56 -0000 > On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes > wrote: > > > > > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, "Rodney W. > > > Grimes" > > > writes: > > > > > Author: cy > > > > > Date: Thu Apr 18 01:02:00 2019 > > > > > New Revision: 346341 > > > > > URL: https://svnweb.freebsd.org/changeset/base/346341 > > > > > > > > > > Log: > > > > > As an interim measure until a more permanent solution is implemented > > > > > workaround the following error: > > > > > > > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of > > > > > undeclared identifier > > > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); > > > > > > > > > > Reported by: O. Hartmann > > > > > Reported by: Michael Butler > > > > > Reported by: gjb@ & cy@ (implicit) > > > > > Reviewed by: emaste@ > > > > > Noted by: rgrimes@ > > > > > > > > > > Modified: > > > > > head/tools/build/Makefile > > > > > > > > > > Modified: head/tools/build/Makefile > > > > > =========================================================================== > > > > === > > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 (r34634 > > > > 0) > > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 (r34634 > > > > 1) > > > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > > > > > INCS+= libcasper.h > > > > > .endif > > > > > > > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > > > > > CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea > > > > rgs.h > > > > > -.endif > > > > > > > > As a further note, we should probably hunt for any thing > > > > that is explicity looking at /usr/include/... in a Makefile, > > > > as that is minimally missing a ${DESTDIR} argument. > > > > > > > > The above may of actually worked if it had been written: > > > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > > > > someone may wish to test that. > > > > > > > > Also a pathname rooted at / without ${DESTDIR} is almost certainly a mistake. > > > > > > This is a better solution. I tested this in a tree with a duplicated > > > environment: Problem solved. Before this is committed it should be > > > tested on one of the universe machines. > > > > From what Ed just said this would also be wrong, > > as well as CASPERINC+= above being wrong, if this > > is being built for the host we should not be using > > any headers from ${SRCTOP} at all. > > > > if capfileargs.h does not exist on the host that functionality > > must not be compiled into the buildtool as the host does not > > have this feature and attempting to use it from SRCTOP is wrong. > > > > Keep in mind that this is bootstrap; it's being built for the host > system, but it will link against a version of libcasper that's been > built in an earlier stage with the proper featureset. Ok, flip flop again, if infact this is linked against a library that implements the stuff from cap_fileargs.h then infact the ${DESTDIR} addition so that the build peaks into the cross build tree is correct, or what ever the equivelent to DESTDIR is for that ? BUILDDIR? The point is it should be picking this header up from the object tree, NOT from the running system. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 18 14:43:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A621F15735EC; Thu, 18 Apr 2019 14:43:56 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE5916A319; Thu, 18 Apr 2019 14:43:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id H8GPhd7x0ldkPH8GQhAm7m; Thu, 18 Apr 2019 08:43:47 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=oexKYjalfGEA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=iaTFZB6CAAAA:8 a=zxA2vyXaAAAA:8 a=YxBL1-UpAAAA:8 a=Z0HR4rKzYdLA8CT5LLUA:9 a=QEXdDO2ut3YA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=nK2txNHJmq7TfjpuLlwI:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [192.168.0.103] (S0106002401cb186f.gv.shawcable.net [70.67.125.17]) by spqr.komquats.com (Postfix) with ESMTPSA id 33A921142; Thu, 18 Apr 2019 07:43:44 -0700 (PDT) Date: Thu, 18 Apr 2019 07:43:43 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> References: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r346341 - head/tools/build To: rgrimes@freebsd.org, "Rodney W. Grimes" , Kyle Evans CC: "Rodney W. Grimes" , Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> X-CMAE-Envelope: MS4wfCQHwB/x0RpW3Tdiut7Dyy+VXL72xUQRWCOmJiapH7DOABzMTA2j9hBMIS9JQGAtBtczVz2sAgNeogEex65/3VIgn6JL1NdYYbnk/HZUN+9FFWMTypQk SQaNsYK+494WXIZ/haz705XxtaEz1NcKwpvfcCUSm+069CMWQexssVfLVB/0uK2IgcjypJ124Qhr2tvE5FWq9lQlKTdoGBMH2Fni9OjSFIkt4Hw2FCyv4i6v bv1oCUazn91ycME7B8+rMZvV5rr1eEadNbNLnwVRk8Mdka9mr1eQSyT6CXv90XZ5c7fFKjHcW+O6eAKsHVYw7NdQrlIwILGFsYpTzfC7UTJrvNnsQCuP1EA6 +EQ4ZHSPsbXvAAgBhTeSMQs09DF1ag== X-Rspamd-Queue-Id: AE5916A319 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,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, 18 Apr 2019 14:43:56 -0000 On April 18, 2019 7:22:53 AM PDT, "Rodney W=2E Grimes" wrote: >> On Thu, Apr 18, 2019 at 8:46 AM Rodney W=2E Grimes >> wrote: >> > >> > > In message <201904180107=2Ex3I17QDc002945@gndrsh=2Ednsmgr=2Enet>, >"Rodney W=2E >> > > Grimes" >> > > writes: >> > > > > Author: cy >> > > > > Date: Thu Apr 18 01:02:00 2019 >> > > > > New Revision: 346341 >> > > > > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/346341 >> > > > > >> > > > > Log: >> > > > > As an interim measure until a more permanent solution is >implemented >> > > > > workaround the following error: >> > > > > >> > > > > /usr/src/contrib/elftoolchain/strings/strings=2Ec:198:55: >error: use of >> > > > > undeclared identifier >> > > > > 'FA_OPEN' fa =3D fileargs_init(argc, argv, O_RDONLY, 0, >&rights, FA_OPEN); >> > > > > >> > > > > Reported by: O=2E Hartmann >> > > > > Reported by: Michael Butler >> > > > > Reported by: gjb@ & cy@ (implicit) >> > > > > Reviewed by: emaste@ >> > > > > Noted by: rgrimes@ >> > > > > >> > > > > Modified: >> > > > > head/tools/build/Makefile >> > > > > >> > > > > Modified: head/tools/build/Makefile >> > > > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> > > > =3D=3D=3D >> > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 =20 > (r34634 >> > > > 0) >> > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 =20 > (r34634 >> > > > 1) >> > > > > @@ -59,9 +59,7 @@ INCS+=3D capsicum_helpers=2Eh >> > > > > INCS+=3D libcasper=2Eh >> > > > > =2Eendif >> > > > > >> > > > > -=2Eif !exists(/usr/include/casper/cap_fileargs=2Eh) >> > > > > CASPERINC+=3D =20 >${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea >> > > > rgs=2Eh >> > > > > -=2Eendif >> > > > >> > > > As a further note, we should probably hunt for any thing >> > > > that is explicity looking at /usr/include/=2E=2E=2E in a Makefile= , >> > > > as that is minimally missing a ${DESTDIR} argument=2E >> > > > >> > > > The above may of actually worked if it had been written: >> > > > =2Eif !exists(${DESTDIR}/usr/include/casper/cap_fileargs=2Eh) >> > > > someone may wish to test that=2E >> > > > >> > > > Also a pathname rooted at / without ${DESTDIR} is almost >certainly a mistake=2E >> > > >> > > This is a better solution=2E I tested this in a tree with a >duplicated >> > > environment: Problem solved=2E Before this is committed it should >be >> > > tested on one of the universe machines=2E >> > >> > From what Ed just said this would also be wrong, >> > as well as CASPERINC+=3D above being wrong, if this >> > is being built for the host we should not be using >> > any headers from ${SRCTOP} at all=2E >> > >> > if capfileargs=2Eh does not exist on the host that functionality >> > must not be compiled into the buildtool as the host does not >> > have this feature and attempting to use it from SRCTOP is wrong=2E >> > >>=20 >> Keep in mind that this is bootstrap; it's being built for the host >> system, but it will link against a version of libcasper that's been >> built in an earlier stage with the proper featureset=2E > >Ok, flip flop again, if infact this is linked against a >library that implements the stuff from cap_fileargs=2Eh then >infact the ${DESTDIR} addition so that the build peaks into >the cross build tree is correct, or what ever the equivelent >to DESTDIR is for that ? BUILDDIR? The point is it should >be picking this header up from the object tree, NOT from >the running system=2E Yes, this was my conclusion when working on kerberos and ntp=2E This is al= so true of libraries, else one would need to installworld and buildworld a= gain to get a properly built library/binary=2E=20 IIRC ngie@ fixed a number of these across the tree a couple of years ago= =2E=20 --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Thu Apr 18 15:12:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA48A15740BC for ; Thu, 18 Apr 2019 15:12:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CBD76B52B for ; Thu, 18 Apr 2019 15:12:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id i14so2508370qtr.10 for ; Thu, 18 Apr 2019 08:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TRSN82XmM4JARmlpawANEUATfqbhfYnuAVuWT0801dI=; b=vdjqhlNNzluCGvTQfZO2ZUlsa1WxQv5mOXg2kN1LJ1/fA+8xigZW0kKeLiL8iWNGpk IPyc9Dv9Avx7reGF/P+VQhg2oB02EbAjlmC2yhkCH1YC88ovDLXLk1yMdeB1MoGB/+IT RfTsGDWDEZseTAu2f2KAk6D0d6y9Te78O58G14l1IzknLAnySDR4SUE9eakL6u+FONC6 Nuife8blpW0eznqrEX8qjdUzryQCFK4N9aI53GMu7o2dDlLc6317lQR8ODMicXNWRiGu LgbBcYm8QIrhRZY5w99CqIqVSJDszeGKOKSv/eARxICFcC2WwWHZlvwJIHspcRZjJcYs xD8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TRSN82XmM4JARmlpawANEUATfqbhfYnuAVuWT0801dI=; b=omms4dY30OGw0ycyCRMQjBIySrFH5dWg73jXazCY2PovsOApyKfgjo/cV0IYFB+eUO ifqlHqJzZJn6YuYhfNWkQmaz/BboVoMFvlYmGRebYSfLYe5aljki9SM6yIwAt047lkNJ Nnti3m0NoW0j6LTznutSql0FEVT2Uu6bekPUwod8+Ow0tMoHrUbr34ofB0sF8IagpEpx 7o16bKv/jx2OJ3yToLQOK8PyK8eiZ9VJW2eJz3MmeszYhAGvvtVE4WDEXUZWfcRSiYBe v4wtU1FHiQBXGQUJaPilofcMlcm8kSCe7l0+nL4fGmdHqGzfYEU/hALQcWE9IhXXKZ6G emOQ== X-Gm-Message-State: APjAAAXQpdveGRP663FvApuZl99020csiGQ1Lrz0/wGXKsfIGenQJRwZ /JUxIkvpHGj3q452+aB3Uoni4U1S8lRlMcKZfLNytg== X-Google-Smtp-Source: APXvYqyZH25ZVhd9VjMTPr2uI3vD4vXH7wPhlfqwT4QxY8KcOSrIOeSxNNGZzTBIjZiNFt0Cjd6GuqNMi3MSH+U0bA0= X-Received: by 2002:ac8:38b6:: with SMTP id f51mr77932163qtc.33.1555600320760; Thu, 18 Apr 2019 08:12:00 -0700 (PDT) MIME-Version: 1.0 References: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> In-Reply-To: <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> From: Warner Losh Date: Thu, 18 Apr 2019 09:11:49 -0600 Message-ID: Subject: Re: svn commit: r346341 - head/tools/build To: Cy Schubert Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , Kyle Evans , Cy Schubert , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 5CBD76B52B 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.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Thu, 18 Apr 2019 15:12:02 -0000 On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert wrote: > On April 18, 2019 7:22:53 AM PDT, "Rodney W. Grimes" < > freebsd@gndrsh.dnsmgr.net> wrote: > >> On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes > >> wrote: > >> > > >> > > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, > >"Rodney W. > >> > > Grimes" > >> > > writes: > >> > > > > Author: cy > >> > > > > Date: Thu Apr 18 01:02:00 2019 > >> > > > > New Revision: 346341 > >> > > > > URL: https://svnweb.freebsd.org/changeset/base/346341 > >> > > > > > >> > > > > Log: > >> > > > > As an interim measure until a more permanent solution is > >implemented > >> > > > > workaround the following error: > >> > > > > > >> > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: > >error: use of > >> > > > > undeclared identifier > >> > > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, > >&rights, FA_OPEN); > >> > > > > > >> > > > > Reported by: O. Hartmann > >> > > > > Reported by: Michael Butler > >> > > > > Reported by: gjb@ & cy@ (implicit) > >> > > > > Reviewed by: emaste@ > >> > > > > Noted by: rgrimes@ > >> > > > > > >> > > > > Modified: > >> > > > > head/tools/build/Makefile > >> > > > > > >> > > > > Modified: head/tools/build/Makefile > >> > > > > > > >=========================================================================== > >> > > > === > >> > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 > > (r34634 > >> > > > 0) > >> > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 > > (r34634 > >> > > > 1) > >> > > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h > >> > > > > INCS+= libcasper.h > >> > > > > .endif > >> > > > > > >> > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) > >> > > > > CASPERINC+= > >${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea > >> > > > rgs.h > >> > > > > -.endif > >> > > > > >> > > > As a further note, we should probably hunt for any thing > >> > > > that is explicity looking at /usr/include/... in a Makefile, > >> > > > as that is minimally missing a ${DESTDIR} argument. > >> > > > > >> > > > The above may of actually worked if it had been written: > >> > > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) > >> > > > someone may wish to test that. > >> > > > > >> > > > Also a pathname rooted at / without ${DESTDIR} is almost > >certainly a mistake. > >> > > > >> > > This is a better solution. I tested this in a tree with a > >duplicated > >> > > environment: Problem solved. Before this is committed it should > >be > >> > > tested on one of the universe machines. > >> > > >> > From what Ed just said this would also be wrong, > >> > as well as CASPERINC+= above being wrong, if this > >> > is being built for the host we should not be using > >> > any headers from ${SRCTOP} at all. > >> > > >> > if capfileargs.h does not exist on the host that functionality > >> > must not be compiled into the buildtool as the host does not > >> > have this feature and attempting to use it from SRCTOP is wrong. > >> > > >> > >> Keep in mind that this is bootstrap; it's being built for the host > >> system, but it will link against a version of libcasper that's been > >> built in an earlier stage with the proper featureset. > > > >Ok, flip flop again, if infact this is linked against a > >library that implements the stuff from cap_fileargs.h then > >infact the ${DESTDIR} addition so that the build peaks into > >the cross build tree is correct, or what ever the equivelent > >to DESTDIR is for that ? BUILDDIR? The point is it should > >be picking this header up from the object tree, NOT from > >the running system. > > Yes, this was my conclusion when working on kerberos and ntp. This is also > true of libraries, else one would need to installworld and buildworld > again to get a properly built library/binary. > > IIRC ngie@ fixed a number of these across the tree a couple of years ago. OK. There's a number of different issues going on. As the original author of libegacy (which is what we're seeing fail), let me address the design generically and comment on different things that have come up in this thread. Since this is going into the libegacy that we're using to build the system, the check for file is bogus, for reasons I'll discuss below. When we add new includes to the system, it is appropriate to do it this way. And when this file was added to the system, the check was correct. First off, DESTDIR is absolutely not correct since this is to build the legacy library and legacy includes which augment the host's sources on legacay system, hence the name. It's never the correct thing to use. The problem that we have here is not that the file is missing (which is why it was added the way it was a long time ago), but rather missing functionality in a file that's been around for a long time. So, since it is that class of problem, the canonical way we've dealt with it in the past is to do something like create a file foo.h that looks something like #include_next #ifndev SOMETHING_NEW #define SOMETHING_NEW 0 /* Or other values that are fail-safe on the old system */ #endif and that's the change that needs to be made here. Sometimes, more extensive things need to be done when the old library can't work at all with the new code. In those cases, the pattern is for foo.h to include #define problem_fn my_problem_fn and then write a my_problem_fn that wraps problem_fn in a way that works on the old system. Kinda a poor man's symbol versioning, in a way (note: we can't use symbol version for this since we're building new binaries). The "stop gap" gets things compiling, and maybe OK for the moment, unless the SOMETHING_NEW variable that's used (in this case FA_OPEN) causes the old library to do the wrong thing. I've not done the deep dive to see if this is the case or not. So, does that make sense? Warner From owner-svn-src-head@freebsd.org Thu Apr 18 15:19:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17C31157473D; Thu, 18 Apr 2019 15:19:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 AE00B6B9F7; Thu, 18 Apr 2019 15:19:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88FDB20BB0; Thu, 18 Apr 2019 15:19:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3IFJJt4090236; Thu, 18 Apr 2019 15:19:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IFJJp6090235; Thu, 18 Apr 2019 15:19:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904181519.x3IFJJp6090235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Apr 2019 15:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346353 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 346353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE00B6B9F7 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)[-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, 18 Apr 2019 15:19:20 -0000 Author: imp Date: Thu Apr 18 15:19:19 2019 New Revision: 346353 URL: https://svnweb.freebsd.org/changeset/base/346353 Log: Minor tweak to the debug Make it clear we're loading from UFS. Modified: head/stand/efi/boot1/ufs_module.c Modified: head/stand/efi/boot1/ufs_module.c ============================================================================== --- head/stand/efi/boot1/ufs_module.c Thu Apr 18 14:18:06 2019 (r346352) +++ head/stand/efi/boot1/ufs_module.c Thu Apr 18 15:19:19 2019 (r346353) @@ -148,7 +148,7 @@ load(const char *filepath, dev_info_t *dev, void **buf #ifdef EFI_DEBUG { CHAR16 *text = efi_devpath_name(dev->devpath); - DPRINTF("Loading '%s' from %S\n", filepath, text); + DPRINTF("UFS Loading '%s' from %S\n", filepath, text); efi_free_devpath_name(text); } #endif From owner-svn-src-head@freebsd.org Thu Apr 18 15:19:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60A03157476C; Thu, 18 Apr 2019 15:19:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 040CF6BAD9; Thu, 18 Apr 2019 15:19:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47CAE20BB1; Thu, 18 Apr 2019 15:19:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3IFJTtv090293; Thu, 18 Apr 2019 15:19:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IFJTrI090292; Thu, 18 Apr 2019 15:19:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904181519.x3IFJTrI090292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Apr 2019 15:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346354 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 346354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 040CF6BAD9 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)[-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, 18 Apr 2019 15:19:30 -0000 Author: imp Date: Thu Apr 18 15:19:28 2019 New Revision: 346354 URL: https://svnweb.freebsd.org/changeset/base/346354 Log: Add note that I'm the defacto maintainer of libegacy, our compat shims for building bootstrap tools that use new features on systems too old to have those new features. The world view for this part of the build is unique to the whole build process and continuty of design for new compat shims help this library remain viable. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Apr 18 15:19:19 2019 (r346353) +++ head/MAINTAINERS Thu Apr 18 15:19:28 2019 (r346354) @@ -102,6 +102,7 @@ sys/netpfil/pf kp,glebius Pre-commit review recommende sys/x86/xen royger Pre-commit review recommended. sys/xen royger Pre-commit review recommended. tests freebsd-testing,ngie Pre-commit review requested. +tools/build imp Pre-commit review requested, especially to fix bootstrap issues. top(1) eadler Pre-commit review requested. usr.sbin/bsdconfig dteske Pre-commit phabricator review requested. usr.sbin/dpv dteske Pre-commit review requested. Keep in sync with libdpv. From owner-svn-src-head@freebsd.org Thu Apr 18 15:31:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 168571574CF9; Thu, 18 Apr 2019 15:31: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 B29096C362; Thu, 18 Apr 2019 15:31: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 8D62B20EB9; Thu, 18 Apr 2019 15:31: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 x3IFV31Z095921; Thu, 18 Apr 2019 15:31:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IFV3k1095920; Thu, 18 Apr 2019 15:31:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904181531.x3IFV3k1095920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Apr 2019 15:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346355 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 346355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B29096C362 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)[-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, 18 Apr 2019 15:31:04 -0000 Author: kib Date: Thu Apr 18 15:31:03 2019 New Revision: 346355 URL: https://svnweb.freebsd.org/changeset/base/346355 Log: Use correct type name. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/x86/iommu/intel_drv.c Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Thu Apr 18 15:19:28 2019 (r346354) +++ head/sys/x86/iommu/intel_drv.c Thu Apr 18 15:31:03 2019 (r346355) @@ -1010,8 +1010,8 @@ dmar_inst_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg printf("dmar%d no dev found for RMRR " "[%#jx, %#jx] rid %#x scope path ", iria->dmar->unit, - (uintptr_t)resmem->BaseAddress, - (uintptr_t)resmem->EndAddress, + (uintmax_t)resmem->BaseAddress, + (uintmax_t)resmem->EndAddress, rid); dmar_print_path(devscope->Bus, dev_path_len, (const ACPI_DMAR_PCI_PATH *)(devscope + 1)); From owner-svn-src-head@freebsd.org Thu Apr 18 16:26:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F371575B8D; Thu, 18 Apr 2019 16:26:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7089B6DC05; Thu, 18 Apr 2019 16:26:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id H9s8heEuwldkPH9sAhB9gm; Thu, 18 Apr 2019 10:26:51 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=oexKYjalfGEA:10 a=7Qk2ozbKAAAA:8 a=YxBL1-UpAAAA:8 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=iaTFZB6CAAAA:8 a=zxA2vyXaAAAA:8 a=aP34avg-Yz-OcyL_pBEA:9 a=c1rMMgh-lkFXqSQV:21 a=TKYzfgdWNDVoTtQd:21 a=QEXdDO2ut3YA:10 a=6k3w9U7lyHsA6R22:21 a=ZS4ouRq1pXnG1s_F:21 a=4C7WCNzWSuQtXfqz:21 a=_W_S_7VecoQA:10 a=1lyxoWkJIXJV6VJUPhuM:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=nK2txNHJmq7TfjpuLlwI:22 Received: from [192.168.0.103] (S0106002401cb186f.gv.shawcable.net [70.67.125.17]) by spqr.komquats.com (Postfix) with ESMTPSA id 98DDE1292; Thu, 18 Apr 2019 09:26:47 -0700 (PDT) Date: Thu, 18 Apr 2019 09:26:47 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> MIME-Version: 1.0 Subject: Re: svn commit: r346341 - head/tools/build To: Warner Losh CC: "Rodney W. Grimes" , "Rodney W. Grimes" , Kyle Evans , Cy Schubert , src-committers , svn-src-all , svn-src-head From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfPc7JPq8qOodCLXTWqksVc+tO7WI7AJcelxR+AgZqW1IYLkBbv9NjlP31M/BQZls0j3tWr6qTS3ClF+DSowuAF8/peL+xzQAtFldw8YzuHRGv8frAR7G hoMqEZJyOFe62JMitGpe00PahsLZLE7XzZblUu1iuHXmFt9DrNstpKk3G6onYkksl8fsmJFTHcAHnFuyjDNYwxtp92zaiMYOe9S73NZ7JSfIR1fKp7G/1kGJ vMVNOFUNQITMBKKjOdwxUB98xs1mQA25vpB0yPtCS52OqDVXMRRhPym3sHxxU4QuYvEwQAyeSdl7rW1XjEQ41EP6PVDwSSA+DwAd3NOb6o93w6tg0AvjkCYY LPvYaIvUrEzdAL+dbVZeEgvp6ABROzaTosAgHyl5H2Gi5U7eAKlv8sDxW/A/Wc3AEkorZ1DC X-Rspamd-Queue-Id: 7089B6DC05 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.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Thu, 18 Apr 2019 16:26:55 -0000 On April 18, 2019 8:11:49 AM PDT, Warner Losh wrote: >On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert >wrote: > >> On April 18, 2019 7:22:53 AM PDT, "Rodney W=2E Grimes" < >> freebsd@gndrsh=2Ednsmgr=2Enet> wrote: >> >> On Thu, Apr 18, 2019 at 8:46 AM Rodney W=2E Grimes >> >> wrote: >> >> > >> >> > > In message <201904180107=2Ex3I17QDc002945@gndrsh=2Ednsmgr=2Enet>= , >> >"Rodney W=2E >> >> > > Grimes" >> >> > > writes: >> >> > > > > Author: cy >> >> > > > > Date: Thu Apr 18 01:02:00 2019 >> >> > > > > New Revision: 346341 >> >> > > > > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/346341 >> >> > > > > >> >> > > > > Log: >> >> > > > > As an interim measure until a more permanent solution is >> >implemented >> >> > > > > workaround the following error: >> >> > > > > >> >> > > > > /usr/src/contrib/elftoolchain/strings/strings=2Ec:198:55: >> >error: use of >> >> > > > > undeclared identifier >> >> > > > > 'FA_OPEN' fa =3D fileargs_init(argc, argv, O_RDONLY, 0, >> >&rights, FA_OPEN); >> >> > > > > >> >> > > > > Reported by: O=2E Hartmann >> >> > > > > Reported by: Michael Butler > >> >> > > > > Reported by: gjb@ & cy@ (implicit) >> >> > > > > Reviewed by: emaste@ >> >> > > > > Noted by: rgrimes@ >> >> > > > > >> >> > > > > Modified: >> >> > > > > head/tools/build/Makefile >> >> > > > > >> >> > > > > Modified: head/tools/build/Makefile >> >> > > > > >> >> >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> >> > > > =3D=3D=3D >> >> > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 >> > (r34634 >> >> > > > 0) >> >> > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 >> > (r34634 >> >> > > > 1) >> >> > > > > @@ -59,9 +59,7 @@ INCS+=3D capsicum_helpers=2Eh >> >> > > > > INCS+=3D libcasper=2Eh >> >> > > > > =2Eendif >> >> > > > > >> >> > > > > -=2Eif !exists(/usr/include/casper/cap_fileargs=2Eh) >> >> > > > > CASPERINC+=3D >> >${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea >> >> > > > rgs=2Eh >> >> > > > > -=2Eendif >> >> > > > >> >> > > > As a further note, we should probably hunt for any thing >> >> > > > that is explicity looking at /usr/include/=2E=2E=2E in a Makef= ile, >> >> > > > as that is minimally missing a ${DESTDIR} argument=2E >> >> > > > >> >> > > > The above may of actually worked if it had been written: >> >> > > > =2Eif !exists(${DESTDIR}/usr/include/casper/cap_fileargs=2Eh) >> >> > > > someone may wish to test that=2E >> >> > > > >> >> > > > Also a pathname rooted at / without ${DESTDIR} is almost >> >certainly a mistake=2E >> >> > > >> >> > > This is a better solution=2E I tested this in a tree with a >> >duplicated >> >> > > environment: Problem solved=2E Before this is committed it >should >> >be >> >> > > tested on one of the universe machines=2E >> >> > >> >> > From what Ed just said this would also be wrong, >> >> > as well as CASPERINC+=3D above being wrong, if this >> >> > is being built for the host we should not be using >> >> > any headers from ${SRCTOP} at all=2E >> >> > >> >> > if capfileargs=2Eh does not exist on the host that functionality >> >> > must not be compiled into the buildtool as the host does not >> >> > have this feature and attempting to use it from SRCTOP is wrong=2E >> >> > >> >> >> >> Keep in mind that this is bootstrap; it's being built for the host >> >> system, but it will link against a version of libcasper that's >been >> >> built in an earlier stage with the proper featureset=2E >> > >> >Ok, flip flop again, if infact this is linked against a >> >library that implements the stuff from cap_fileargs=2Eh then >> >infact the ${DESTDIR} addition so that the build peaks into >> >the cross build tree is correct, or what ever the equivelent >> >to DESTDIR is for that ? BUILDDIR? The point is it should >> >be picking this header up from the object tree, NOT from >> >the running system=2E >> >> Yes, this was my conclusion when working on kerberos and ntp=2E This is >also >> true of libraries, else one would need to installworld and >buildworld >> again to get a properly built library/binary=2E >> >> IIRC ngie@ fixed a number of these across the tree a couple of years >ago=2E > > >OK=2E There's a number of different issues going on=2E As the original >author >of libegacy (which is what we're seeing fail), let me address the >design >generically and comment on different things that have come up in this >thread=2E > >Since this is going into the libegacy that we're using to build the >system, >the check for file is bogus, for reasons I'll discuss below=2E When we >add >new includes to the system, it is appropriate to do it this way=2E And >when >this file was added to the system, the check was correct=2E > >First off, DESTDIR is absolutely not correct since this is to build the >legacy library and legacy includes which augment the host's sources on >legacay system, hence the name=2E It's never the correct thing to use=2E > >The problem that we have here is not that the file is missing (which is >why >it was added the way it was a long time ago), but rather missing >functionality in a file that's been around for a long time=2E > >So, since it is that class of problem, the canonical way we've dealt >with >it in the past is to do something like create a file foo=2Eh that looks >something like > >#include_next > >#ifndev SOMETHING_NEW >#define SOMETHING_NEW 0 /* Or other values that are fail-safe on the >old >system */ >#endif > >and that's the change that needs to be made here=2E Sometimes, more >extensive >things need to be done when the old library can't work at all with the >new >code=2E In those cases, the pattern is for foo=2Eh to include #define >problem_fn my_problem_fn and then write a my_problem_fn that wraps >problem_fn in a way that works on the old system=2E Kinda a poor man's >symbol >versioning, in a way (note: we can't use symbol version for this since >we're building new binaries)=2E > >The "stop gap" gets things compiling, and maybe OK for the moment, >unless >the SOMETHING_NEW variable that's used (in this case FA_OPEN) causes >the >old library to do the wrong thing=2E I've not done the deep dive to see >if >this is the case or not=2E > >So, does that make sense? > >Warner This solves one problem but what about the cases when a new krb5, ntp, or = amd is imported but fails to build because it is using the old headers in /= usr/include and linking against old libraries on the running system? These examples BTW have been fixed=2E My concern is there could be other e= xamples in contrib, yet to be discovered, that might also have the same iss= ues=2E=20 --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Thu Apr 18 16:59:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1A3815766A6; Thu, 18 Apr 2019 16:59:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92DB26EDC2; Thu, 18 Apr 2019 16:59:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 692359074; Thu, 18 Apr 2019 16:59:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346341 - head/tools/build To: Cy Schubert , Warner Losh Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , Kyle Evans , Cy Schubert , src-committers , svn-src-all , svn-src-head References: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> 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: <5ba297cb-e97b-2ac7-58ee-971545581f08@FreeBSD.org> Date: Thu, 18 Apr 2019 09:59:02 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 92DB26EDC2 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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.980,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, 18 Apr 2019 16:59:06 -0000 On 4/18/19 9:26 AM, Cy Schubert wrote: > On April 18, 2019 8:11:49 AM PDT, Warner Losh wrote: >> On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert >> wrote: >> >>> On April 18, 2019 7:22:53 AM PDT, "Rodney W. Grimes" < >>> freebsd@gndrsh.dnsmgr.net> wrote: >>>>> On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes >>>>> wrote: >>>>>> >>>>>>> In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, >>>> "Rodney W. >>>>>>> Grimes" >>>>>>> writes: >>>>>>>>> Author: cy >>>>>>>>> Date: Thu Apr 18 01:02:00 2019 >>>>>>>>> New Revision: 346341 >>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/346341 >>>>>>>>> >>>>>>>>> Log: >>>>>>>>> As an interim measure until a more permanent solution is >>>> implemented >>>>>>>>> workaround the following error: >>>>>>>>> >>>>>>>>> /usr/src/contrib/elftoolchain/strings/strings.c:198:55: >>>> error: use of >>>>>>>>> undeclared identifier >>>>>>>>> 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, >>>> &rights, FA_OPEN); >>>>>>>>> >>>>>>>>> Reported by: O. Hartmann >>>>>>>>> Reported by: Michael Butler >> >>>>>>>>> Reported by: gjb@ & cy@ (implicit) >>>>>>>>> Reviewed by: emaste@ >>>>>>>>> Noted by: rgrimes@ >>>>>>>>> >>>>>>>>> Modified: >>>>>>>>> head/tools/build/Makefile >>>>>>>>> >>>>>>>>> Modified: head/tools/build/Makefile >>>>>>>>> >>> >>> >>> =========================================================================== >>>>>>>> === >>>>>>>>> --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 >>>> (r34634 >>>>>>>> 0) >>>>>>>>> +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 >>>> (r34634 >>>>>>>> 1) >>>>>>>>> @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h >>>>>>>>> INCS+= libcasper.h >>>>>>>>> .endif >>>>>>>>> >>>>>>>>> -.if !exists(/usr/include/casper/cap_fileargs.h) >>>>>>>>> CASPERINC+= >>>> ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea >>>>>>>> rgs.h >>>>>>>>> -.endif >>>>>>>> >>>>>>>> As a further note, we should probably hunt for any thing >>>>>>>> that is explicity looking at /usr/include/... in a Makefile, >>>>>>>> as that is minimally missing a ${DESTDIR} argument. >>>>>>>> >>>>>>>> The above may of actually worked if it had been written: >>>>>>>> .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) >>>>>>>> someone may wish to test that. >>>>>>>> >>>>>>>> Also a pathname rooted at / without ${DESTDIR} is almost >>>> certainly a mistake. >>>>>>> >>>>>>> This is a better solution. I tested this in a tree with a >>>> duplicated >>>>>>> environment: Problem solved. Before this is committed it >> should >>>> be >>>>>>> tested on one of the universe machines. >>>>>> >>>>>> From what Ed just said this would also be wrong, >>>>>> as well as CASPERINC+= above being wrong, if this >>>>>> is being built for the host we should not be using >>>>>> any headers from ${SRCTOP} at all. >>>>>> >>>>>> if capfileargs.h does not exist on the host that functionality >>>>>> must not be compiled into the buildtool as the host does not >>>>>> have this feature and attempting to use it from SRCTOP is wrong. >>>>>> >>>>> >>>>> Keep in mind that this is bootstrap; it's being built for the host >>>>> system, but it will link against a version of libcasper that's >> been >>>>> built in an earlier stage with the proper featureset. >>>> >>>> Ok, flip flop again, if infact this is linked against a >>>> library that implements the stuff from cap_fileargs.h then >>>> infact the ${DESTDIR} addition so that the build peaks into >>>> the cross build tree is correct, or what ever the equivelent >>>> to DESTDIR is for that ? BUILDDIR? The point is it should >>>> be picking this header up from the object tree, NOT from >>>> the running system. >>> >>> Yes, this was my conclusion when working on kerberos and ntp. This is >> also >>> true of libraries, else one would need to installworld and >> buildworld >>> again to get a properly built library/binary. >>> >>> IIRC ngie@ fixed a number of these across the tree a couple of years >> ago. >> >> >> OK. There's a number of different issues going on. As the original >> author >> of libegacy (which is what we're seeing fail), let me address the >> design >> generically and comment on different things that have come up in this >> thread. >> >> Since this is going into the libegacy that we're using to build the >> system, >> the check for file is bogus, for reasons I'll discuss below. When we >> add >> new includes to the system, it is appropriate to do it this way. And >> when >> this file was added to the system, the check was correct. >> >> First off, DESTDIR is absolutely not correct since this is to build the >> legacy library and legacy includes which augment the host's sources on >> legacay system, hence the name. It's never the correct thing to use. >> >> The problem that we have here is not that the file is missing (which is >> why >> it was added the way it was a long time ago), but rather missing >> functionality in a file that's been around for a long time. >> >> So, since it is that class of problem, the canonical way we've dealt >> with >> it in the past is to do something like create a file foo.h that looks >> something like >> >> #include_next >> >> #ifndev SOMETHING_NEW >> #define SOMETHING_NEW 0 /* Or other values that are fail-safe on the >> old >> system */ >> #endif >> >> and that's the change that needs to be made here. Sometimes, more >> extensive >> things need to be done when the old library can't work at all with the >> new >> code. In those cases, the pattern is for foo.h to include #define >> problem_fn my_problem_fn and then write a my_problem_fn that wraps >> problem_fn in a way that works on the old system. Kinda a poor man's >> symbol >> versioning, in a way (note: we can't use symbol version for this since >> we're building new binaries). >> >> The "stop gap" gets things compiling, and maybe OK for the moment, >> unless >> the SOMETHING_NEW variable that's used (in this case FA_OPEN) causes >> the >> old library to do the wrong thing. I've not done the deep dive to see >> if >> this is the case or not. >> >> So, does that make sense? >> >> Warner > > This solves one problem but what about the cases when a new krb5, ntp, or amd is imported but fails to build because it is using the old headers in /usr/include and linking against old libraries on the running system? > > These examples BTW have been fixed. My concern is there could be other examples in contrib, yet to be discovered, that might also have the same issues. We don't build those as bootstrap tools. This step is a special thing only needed to build tools that run on the _host_ that are used when compiling the world. All of the rest of world, etc. is compiled against the SYSROOT. This step is how you build the tools you need to generate the SYSROOT. strings is one of these special tools, so it requires extra care. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Apr 18 17:00:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 507BA1576723 for ; Thu, 18 Apr 2019 17:00:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC94D6EF11 for ; Thu, 18 Apr 2019 17:00:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x734.google.com with SMTP id p185so1435498qkb.8 for ; Thu, 18 Apr 2019 10:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DQV4bb7NwbFZ1QubfQTqh0TYWQr2iSr4H9I8BVBIfKE=; b=1NHIVnE1wUKk1o1gHdZiRjJZ3u30N0ZdIJPsSxsvMJ7lyuevJ0xeGYcBm8DdO1JVqU TugaOidE7Zgv4tQbp4jPsTJWm/QsXg0b+IaO6M2dg4+33gE9CLdGGJgwW08QOs5cky3l qH2Y/fto1jVkgPvmSFn1X0wER3LSz79e1FmnpDD/zwUZHvYo4YJP4xY9cc+iK0BIVhb6 CpkgU1KzlQhZXWW/g44tIJ7/U93NgX8F/UBw/n9usQtPfhqkkJ6MbdzJQdiepTpwvAnZ 9arXp6uYm7iC56vfS2ftMRfO6xPM5eOska/x06CBO4e6roHRCHKHRuDMILEdFBE/cXKQ o/UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DQV4bb7NwbFZ1QubfQTqh0TYWQr2iSr4H9I8BVBIfKE=; b=MGDG0dBTriIcVfRCLG+3J97CxHyQegMpKGO+1DsrZhatE/TeYC403gMds5Hi4h7Lcw lgwPXHJ8sRYsO4eTu0Tg2O5EvJtQuw9NiZ+7fFM0bm5j4eIBoa5utR1s0m+4UeBtXkii fXdmdpvaRIQcM46S+KLaU9KxWNMasUPf9ZvhKh9qi6RQRLh7VqdX0BZQRSoAmAid2one acxJByShf9W5n/O3QER3AHtR7dtpvPH22zT5kppLOW6lLy987QZvwpq4A631gYLdq2tg ZaeOvopVDmPq6S4yuWvuQfYwcC69OwOrgyWML7uCOyFu2DAuYcpYfibVvvoDqI6OUcmJ mKkg== X-Gm-Message-State: APjAAAXG+/dKBg+AkEjPmX6631go0xmMuRqfhQJi/7Trpos8VhRs3QvN yx1pYZk8DNb+3UFQnxwlilKH2uIzaljpKh3X71/yjA== X-Google-Smtp-Source: APXvYqzf2sTTeWKfNbzGtsoTBgp9s2Inshh3qIKEFmIrjVPxo/E74BfIrvu36h7IllKbzvx0P7WWk6EcmXMLW/k9owY= X-Received: by 2002:a05:620a:11a6:: with SMTP id c6mr10663183qkk.46.1555606802302; Thu, 18 Apr 2019 10:00:02 -0700 (PDT) MIME-Version: 1.0 References: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> In-Reply-To: From: Warner Losh Date: Thu, 18 Apr 2019 10:59:50 -0600 Message-ID: Subject: Re: svn commit: r346341 - head/tools/build To: Cy Schubert Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , Kyle Evans , Cy Schubert , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: DC94D6EF11 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.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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: Thu, 18 Apr 2019 17:00:03 -0000 On Thu, Apr 18, 2019 at 10:26 AM Cy Schubert wrote: > On April 18, 2019 8:11:49 AM PDT, Warner Losh wrote: >> >> >> >> On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert >> wrote: >> >>> On April 18, 2019 7:22:53 AM PDT, "Rodney W. Grimes" < >>> freebsd@gndrsh.dnsmgr.net> wrote: >>> >> On Thu, Apr 18, 2019 at 8:46 AM Rodney W. Grimes >>> >> wrote: >>> >> > >>> >> > > In message <201904180107.x3I17QDc002945@gndrsh.dnsmgr.net>, >>> >"Rodney W. >>> >> > > Grimes" >>> >> > > writes: >>> >> > > > > Author: cy >>> >> > > > > Date: Thu Apr 18 01:02:00 2019 >>> >> > > > > New Revision: 346341 >>> >> > > > > URL: https://svnweb.freebsd.org/changeset/base/346341 >>> >> > > > > >>> >> > > > > Log: >>> >> > > > > As an interim measure until a more permanent solution is >>> >implemented >>> >> > > > > workaround the following error: >>> >> > > > > >>> >> > > > > /usr/src/contrib/elftoolchain/strings/strings.c:198:55: >>> >error: use of >>> >> > > > > undeclared identifier >>> >> > > > > 'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, >>> >&rights, FA_OPEN); >>> >> > > > > >>> >> > > > > Reported by: O. Hartmann >>> >> > > > > Reported by: Michael Butler >>> >> > > > > Reported by: gjb@ & cy@ (implicit) >>> >> > > > > Reviewed by: emaste@ >>> >> > > > > Noted by: rgrimes@ >>> >> > > > > >>> >> > > > > Modified: >>> >> > > > > head/tools/build/Makefile >>> >> > > > > >>> >> > > > > Modified: head/tools/build/Makefile >>> >> > > > > >>> >>> >=========================================================================== >>> >> > > > === >>> >> > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 2019 >>> > (r34634 >>> >> > > > 0) >>> >> > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 2019 >>> > (r34634 >>> >> > > > 1) >>> >> > > > > @@ -59,9 +59,7 @@ INCS+= capsicum_helpers.h >>> >> > > > > INCS+= libcasper.h >>> >> > > > > .endif >>> >> > > > > >>> >> > > > > -.if !exists(/usr/include/casper/cap_fileargs.h) >>> >> > > > > CASPERINC+= >>> >${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea >>> >> > > > rgs.h >>> >> > > > > -.endif >>> >> > > > >>> >> > > > As a further note, we should probably hunt for any thing >>> >> > > > that is explicity looking at /usr/include/... in a Makefile, >>> >> > > > as that is minimally missing a ${DESTDIR} argument. >>> >> > > > >>> >> > > > The above may of actually worked if it had been written: >>> >> > > > .if !exists(${DESTDIR}/usr/include/casper/cap_fileargs.h) >>> >> > > > someone may wish to test that. >>> >> > > > >>> >> > > > Also a pathname rooted at / without ${DESTDIR} is almost >>> >certainly a mistake. >>> >> > > >>> >> > > This is a better solution. I tested this in a tree with a >>> >duplicated >>> >> > > environment: Problem solved. Before this is committed it should >>> >be >>> >> > > tested on one of the universe machines. >>> >> > >>> >> > From what Ed just said this would also be wrong, >>> >> > as well as CASPERINC+= above being wrong, if this >>> >> > is being built for the host we should not be using >>> >> > any headers from ${SRCTOP} at all. >>> >> > >>> >> > if capfileargs.h does not exist on the host that functionality >>> >> > must not be compiled into the buildtool as the host does not >>> >> > have this feature and attempting to use it from SRCTOP is wrong. >>> >> > >>> >> >>> >> Keep in mind that this is bootstrap; it's being built for the host >>> >> system, but it will link against a version of libcasper that's been >>> >> built in an earlier stage with the proper featureset. >>> > >>> >Ok, flip flop again, if infact this is linked against a >>> >library that implements the stuff from cap_fileargs.h then >>> >infact the ${DESTDIR} addition so that the build peaks into >>> >the cross build tree is correct, or what ever the equivelent >>> >to DESTDIR is for that ? BUILDDIR? The point is it should >>> >be picking this header up from the object tree, NOT from >>> >the running system. >>> >>> Yes, this was my conclusion when working on kerberos and ntp. This is >>> also true of libraries, else one would need to installworld and buildworld >>> again to get a properly built library/binary. >>> >>> IIRC ngie@ fixed a number of these across the tree a couple of years >>> ago. >> >> >> OK. There's a number of different issues going on. As the original author >> of libegacy (which is what we're seeing fail), let me address the design >> generically and comment on different things that have come up in this >> thread. >> >> Since this is going into the libegacy that we're using to build the >> system, the check for file is bogus, for reasons I'll discuss below. When >> we add new includes to the system, it is appropriate to do it this way. And >> when this file was added to the system, the check was correct. >> >> First off, DESTDIR is absolutely not correct since this is to build the >> legacy library and legacy includes which augment the host's sources on >> legacay system, hence the name. It's never the correct thing to use. >> >> The problem that we have here is not that the file is missing (which is >> why it was added the way it was a long time ago), but rather missing >> functionality in a file that's been around for a long time. >> >> So, since it is that class of problem, the canonical way we've dealt with >> it in the past is to do something like create a file foo.h that looks >> something like >> >> #include_next >> >> #ifndev SOMETHING_NEW >> #define SOMETHING_NEW 0 /* Or other values that are fail-safe on the old >> system */ >> #endif >> >> and that's the change that needs to be made here. Sometimes, more >> extensive things need to be done when the old library can't work at all >> with the new code. In those cases, the pattern is for foo.h to include >> #define problem_fn my_problem_fn and then write a my_problem_fn that wraps >> problem_fn in a way that works on the old system. Kinda a poor man's symbol >> versioning, in a way (note: we can't use symbol version for this since >> we're building new binaries). >> >> The "stop gap" gets things compiling, and maybe OK for the moment, unless >> the SOMETHING_NEW variable that's used (in this case FA_OPEN) causes the >> old library to do the wrong thing. I've not done the deep dive to see if >> this is the case or not. >> >> So, does that make sense? >> >> Warner >> > > This solves one problem but what about the cases when a new krb5, ntp, or > amd is imported but fails to build because it is using the old headers in > /usr/include and linking against old libraries on the running system? > > These examples BTW have been fixed. My concern is there could be other > examples in contrib, yet to be discovered, that might also have the same > issues. > That's the whole point if libegacy: to provide the glue that's needed for the bootstrap process. I'm surprised that ntp or amd are involved with libegacy at all since they aren't bootstrap tools. Are you sure you aren't confusing two different problem domains? I know kerberos is, but it kinda needs to be. Warner From owner-svn-src-head@freebsd.org Thu Apr 18 17:37:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432C215775FE; Thu, 18 Apr 2019 17:37:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 04C257067C; Thu, 18 Apr 2019 17:37:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id HAyhhxYtqsAGkHAyjhLtfn; Thu, 18 Apr 2019 11:37:42 -0600 X-Authority-Analysis: v=2.3 cv=WeVylHpX c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=oexKYjalfGEA:10 a=7Qk2ozbKAAAA:8 a=YxBL1-UpAAAA:8 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=iaTFZB6CAAAA:8 a=zxA2vyXaAAAA:8 a=PEp_QB5gzuGBnP-JFm0A:9 a=7FaDiMKna2wrQ8zq:21 a=zHhFJdDF3MAfcgv_:21 a=QEXdDO2ut3YA:10 a=K0OccMdgBH2YJbIUUJkA:9 a=E0xnkuw_hmWRA0Fy:21 a=L5zBaabDEDj39vuA:21 a=Vjm11AqRlWPGOZTs:21 a=_W_S_7VecoQA:10 a=1lyxoWkJIXJV6VJUPhuM:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=nK2txNHJmq7TfjpuLlwI:22 Received: from [192.168.0.103] (S0106002401cb186f.gv.shawcable.net [70.67.125.17]) by spqr.komquats.com (Postfix) with ESMTPSA id 28A8813AF; Thu, 18 Apr 2019 10:37:39 -0700 (PDT) Date: Thu, 18 Apr 2019 10:37:38 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <201904181422.x3IEMrux005930@gndrsh.dnsmgr.net> <3095E422-7865-4EA5-BF13-6A48CB542AEE@cschubert.com> MIME-Version: 1.0 Subject: Re: svn commit: r346341 - head/tools/build To: Warner Losh CC: "Rodney W. Grimes" , "Rodney W. Grimes" , Kyle Evans , Cy Schubert , src-committers , svn-src-all , svn-src-head From: Cy Schubert Message-ID: <3E54A972-27CE-498F-B0B9-B65A6E87F213@cschubert.com> X-CMAE-Envelope: MS4wfEmillLAy8HivkgIF8cTyGi5emn60y0OAGShBwcF0QIiRmAcw+7+EjCZto7n2UWEO26TMVewDM1kbS5atDBvnpEfPRUI3sQgYNGrMVDlkIHlFqFR6gzT J/V1mOO2nI1QyFDbgg7JW3KdBZRONtMRoB74gh5WD8JDefd5VTpMDCKXhusqSRGxCVAfSAOuweZUlEVZKI7yafVTQntYmfpe5HqtJeGEFG1mRiIrxcv8WMns q5FO3bV2zwd5vmLV1YqpNFHWk3AXejTfnU2ZWPGuceaq5sUeqoLSxHi5BycxJYIxbQaGIUIGR+M+5ST5XZnKO/XffIamWQS5AVY+91RgUN1zcsngHZz9+3gA SYCRp95rR5KtQ7neMu+LzDxf9E4FpbA3wRiBcdls+GpUpBCgJcHmlrtBBqKfK7szHpfKWD+J X-Rspamd-Queue-Id: 04C257067C 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.992,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Thu, 18 Apr 2019 17:37:46 -0000 On April 18, 2019 9:59:50 AM PDT, Warner Losh wrote: >On Thu, Apr 18, 2019 at 10:26 AM Cy Schubert > >wrote: > >> On April 18, 2019 8:11:49 AM PDT, Warner Losh wrote: >>> >>> >>> >>> On Thu, Apr 18, 2019 at 8:44 AM Cy Schubert > >>> wrote: >>> >>>> On April 18, 2019 7:22:53 AM PDT, "Rodney W=2E Grimes" < >>>> freebsd@gndrsh=2Ednsmgr=2Enet> wrote: >>>> >> On Thu, Apr 18, 2019 at 8:46 AM Rodney W=2E Grimes >>>> >> wrote: >>>> >> > >>>> >> > > In message <201904180107=2Ex3I17QDc002945@gndrsh=2Ednsmgr=2Ene= t>, >>>> >"Rodney W=2E >>>> >> > > Grimes" >>>> >> > > writes: >>>> >> > > > > Author: cy >>>> >> > > > > Date: Thu Apr 18 01:02:00 2019 >>>> >> > > > > New Revision: 346341 >>>> >> > > > > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/346341 >>>> >> > > > > >>>> >> > > > > Log: >>>> >> > > > > As an interim measure until a more permanent solution >is >>>> >implemented >>>> >> > > > > workaround the following error: >>>> >> > > > > >>>> >> > > > > =20 >/usr/src/contrib/elftoolchain/strings/strings=2Ec:198:55: >>>> >error: use of >>>> >> > > > > undeclared identifier >>>> >> > > > > 'FA_OPEN' fa =3D fileargs_init(argc, argv, O_RDONLY, 0, >>>> >&rights, FA_OPEN); >>>> >> > > > > >>>> >> > > > > Reported by: O=2E Hartmann >>>> >> > > > > Reported by: Michael Butler > >>>> >> > > > > Reported by: gjb@ & cy@ (implicit) >>>> >> > > > > Reviewed by: emaste@ >>>> >> > > > > Noted by: rgrimes@ >>>> >> > > > > >>>> >> > > > > Modified: >>>> >> > > > > head/tools/build/Makefile >>>> >> > > > > >>>> >> > > > > Modified: head/tools/build/Makefile >>>> >> > > > > >>>> >>>> >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >>>> >> > > > =3D=3D=3D >>>> >> > > > > --- head/tools/build/Makefile Thu Apr 18 00:38:54 >2019 >>>> > (r34634 >>>> >> > > > 0) >>>> >> > > > > +++ head/tools/build/Makefile Thu Apr 18 01:02:00 >2019 >>>> > (r34634 >>>> >> > > > 1) >>>> >> > > > > @@ -59,9 +59,7 @@ INCS+=3D capsicum_helpers=2Eh >>>> >> > > > > INCS+=3D libcasper=2Eh >>>> >> > > > > =2Eendif >>>> >> > > > > >>>> >> > > > > -=2Eif !exists(/usr/include/casper/cap_fileargs=2Eh) >>>> >> > > > > CASPERINC+=3D >>>> >${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_filea >>>> >> > > > rgs=2Eh >>>> >> > > > > -=2Eendif >>>> >> > > > >>>> >> > > > As a further note, we should probably hunt for any thing >>>> >> > > > that is explicity looking at /usr/include/=2E=2E=2E in a >Makefile, >>>> >> > > > as that is minimally missing a ${DESTDIR} argument=2E >>>> >> > > > >>>> >> > > > The above may of actually worked if it had been written: >>>> >> > > > =2Eif !exists(${DESTDIR}/usr/include/casper/cap_fileargs=2Eh= ) >>>> >> > > > someone may wish to test that=2E >>>> >> > > > >>>> >> > > > Also a pathname rooted at / without ${DESTDIR} is almost >>>> >certainly a mistake=2E >>>> >> > > >>>> >> > > This is a better solution=2E I tested this in a tree with a >>>> >duplicated >>>> >> > > environment: Problem solved=2E Before this is committed it >should >>>> >be >>>> >> > > tested on one of the universe machines=2E >>>> >> > >>>> >> > From what Ed just said this would also be wrong, >>>> >> > as well as CASPERINC+=3D above being wrong, if this >>>> >> > is being built for the host we should not be using >>>> >> > any headers from ${SRCTOP} at all=2E >>>> >> > >>>> >> > if capfileargs=2Eh does not exist on the host that functionality >>>> >> > must not be compiled into the buildtool as the host does not >>>> >> > have this feature and attempting to use it from SRCTOP is >wrong=2E >>>> >> > >>>> >> >>>> >> Keep in mind that this is bootstrap; it's being built for the >host >>>> >> system, but it will link against a version of libcasper that's >been >>>> >> built in an earlier stage with the proper featureset=2E >>>> > >>>> >Ok, flip flop again, if infact this is linked against a >>>> >library that implements the stuff from cap_fileargs=2Eh then >>>> >infact the ${DESTDIR} addition so that the build peaks into >>>> >the cross build tree is correct, or what ever the equivelent >>>> >to DESTDIR is for that ? BUILDDIR? The point is it should >>>> >be picking this header up from the object tree, NOT from >>>> >the running system=2E >>>> >>>> Yes, this was my conclusion when working on kerberos and ntp=2E This >is >>>> also true of libraries, else one would need to installworld and >buildworld >>>> again to get a properly built library/binary=2E >>>> >>>> IIRC ngie@ fixed a number of these across the tree a couple of >years >>>> ago=2E >>> >>> >>> OK=2E There's a number of different issues going on=2E As the original >author >>> of libegacy (which is what we're seeing fail), let me address the >design >>> generically and comment on different things that have come up in >this >>> thread=2E >>> >>> Since this is going into the libegacy that we're using to build the >>> system, the check for file is bogus, for reasons I'll discuss below=2E > When >>> we add new includes to the system, it is appropriate to do it this >way=2E And >>> when this file was added to the system, the check was correct=2E >>> >>> First off, DESTDIR is absolutely not correct since this is to build >the >>> legacy library and legacy includes which augment the host's sources >on >>> legacay system, hence the name=2E It's never the correct thing to use= =2E >>> >>> The problem that we have here is not that the file is missing (which >is >>> why it was added the way it was a long time ago), but rather missing >>> functionality in a file that's been around for a long time=2E >>> >>> So, since it is that class of problem, the canonical way we've dealt >with >>> it in the past is to do something like create a file foo=2Eh that >looks >>> something like >>> >>> #include_next >>> >>> #ifndev SOMETHING_NEW >>> #define SOMETHING_NEW 0 /* Or other values that are fail-safe on the >old >>> system */ >>> #endif >>> >>> and that's the change that needs to be made here=2E Sometimes, more >>> extensive things need to be done when the old library can't work at >all >>> with the new code=2E In those cases, the pattern is for foo=2Eh to >include >>> #define problem_fn my_problem_fn and then write a my_problem_fn that >wraps >>> problem_fn in a way that works on the old system=2E Kinda a poor man's >symbol >>> versioning, in a way (note: we can't use symbol version for this >since >>> we're building new binaries)=2E >>> >>> The "stop gap" gets things compiling, and maybe OK for the moment, >unless >>> the SOMETHING_NEW variable that's used (in this case FA_OPEN) causes >the >>> old library to do the wrong thing=2E I've not done the deep dive to >see if >>> this is the case or not=2E >>> >>> So, does that make sense? >>> >>> Warner >>> >> >> This solves one problem but what about the cases when a new krb5, >ntp, or >> amd is imported but fails to build because it is using the old >headers in >> /usr/include and linking against old libraries on the running system? >> >> These examples BTW have been fixed=2E My concern is there could be >other >> examples in contrib, yet to be discovered, that might also have the >same >> issues=2E >> > >That's the whole point if libegacy: to provide the glue that's needed >for >the bootstrap process=2E I'm surprised that ntp or amd are involved with >libegacy at all since they aren't bootstrap tools=2E Are you sure you >aren't >confusing two different problem domains? I know kerberos is, but it >kinda >needs to be=2E > >Warner Maybe I am conflating the two issues=2E I'll look again the next time I ge= t to a keyboard=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Thu Apr 18 18:02:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21748157823D; Thu, 18 Apr 2019 18:02:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3E537222E; Thu, 18 Apr 2019 18:02:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f52.google.com with SMTP id m188so1506825ioa.9; Thu, 18 Apr 2019 11:02:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zj4LNXjz/2GuSOEUMX8Pe7F0GsmvqvcIkzsXk5yOrrQ=; b=m2T6sXN/O+7KKCEOt3zponhzubBjCqBB5Cih6fRmFCzPOENDoNQyd3Oq842NdsfkMq nskrJRiDp8Td/0U7VZpnyG0p8m2K4Oh2COnzYUchLays62bfNjKMxhWy5RbPWPzYac+o wrHMc9N2X5W6IiyHq59C+En6ru+08WHEyMn8AJaZH361uRqYutnUm696FmMMO1AO4q5U LS5szqde0jEnyEbWpUIQj9cYX9bGqkY2m2lVHE7QIj4T36zXRikalFdfrU/d5gqriVVU gRRPGh++/qdOLSZgYdxwK84zFgiEBsKrXWdOtd0pm7kLU7lWMUFiHnGr1RiMIWpOcstY qZHQ== X-Gm-Message-State: APjAAAVIDvCpsWO8s2wAkenmUSsOgLMrMmbKN/yPAJDfP8SNHRwp1xq7 YL3Xg1I3/ePLQ82QEcmyoVnj2Yo3yhEbHE2GQC9g5Q== X-Google-Smtp-Source: APXvYqxCIQ9atq0FLSFQUBoSo04LYTZdPdo8cG0uMhEjLt/L4l2VKgGZY5RZpcSsxvKw9V92ZR9WzQwt3rf33STQID8= X-Received: by 2002:a5d:8184:: with SMTP id u4mr10630269ion.239.1555610512079; Thu, 18 Apr 2019 11:01:52 -0700 (PDT) MIME-Version: 1.0 References: <201904180332.x3I3WJTt096491@slippy.cwsent.com> <201904181345.x3IDjgr4005764@gndrsh.dnsmgr.net> In-Reply-To: From: Ed Maste Date: Thu, 18 Apr 2019 14:01:39 -0400 Message-ID: Subject: Re: svn commit: r346341 - head/tools/build To: Kyle Evans Cc: "Rodney W. Grimes" , Cy Schubert , Cy Schubert , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A3E537222E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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, 18 Apr 2019 18:02:05 -0000 On Thu, 18 Apr 2019 at 10:03, Kyle Evans wrote: > > Keep in mind that this is bootstrap; it's being built for the host > system, but it will link against a version of libcasper that's been > built in an earlier stage with the proper featureset. Not exactly the case here: if building on a system with too-old Casper then strings just builds without Capsicum/Casper support. Macros / static inline stub implementations in the header takes care of this, it does not actually link against any libcasper. From owner-svn-src-head@freebsd.org Thu Apr 18 18:04:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E03D1578565 for ; Thu, 18 Apr 2019 18:04:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0C0172B0B for ; Thu, 18 Apr 2019 18:04:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72b.google.com with SMTP id b74so1661883qkg.9 for ; Thu, 18 Apr 2019 11:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EmeCNmitZD0w6BybPlHKXGFCEUhrW6A8tp9Me1vqIPk=; b=AkmVOIYmYL+PNEc/1nRbL84EKD6sQSjqtkAYKLFHrVKKg4Yqlbj/AeOeJSChlV9bL0 Sbl/zOCsYZ0Oh8cUFGozcXV1oIZwsuGZ9aCUBFRiQk7ZfxgCwhZuIKFzPhYfKXMZhNcT yil0gf4EA21iO+HoP/styywSzoNs7yyzq8nG2VGHQnR3hqyEJcr8k3mxza9xr/SaI87U 7Qwou2p76Z59m/03F2BfMsdrQPmFsB+osprRIm4OIHvsaTk5JG9Ry07jNcQ0rVu8rWAc 924ZBzyNPMwa/56ID2qIPcojNfb81fyjMhTziZb3by956mnWhORp/0IdTEH9WW9hK3KO FMMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EmeCNmitZD0w6BybPlHKXGFCEUhrW6A8tp9Me1vqIPk=; b=I8w6Z4NoQHE6K/JqeVWxgBZIBlAMILbxq57iAnKfI+FlCVzYNTSWeO/Ikzg7IbRfGt tjKS29VVxMgWFZemy/N04WSUU9Gk39v74dNMM2f6LhlPRhyRCylPg2mP81NWJJcS4mR5 kpfh2k/cTjQ6PT//wOl82NvdP2TKHuaxab5a4IQv+e+eu5AtJppQ171ypgKtOHVRxGdf T90fax1mKHuH8EhhHfQ9StUqw8aHv+76ViKOOXiXcG1Kl8NbHZt+ISiy43ghxreRG3iB eJlQ0EYGznE2VgN+Kfl3a3mGWfipeoou98dG19Eu7+8/lRvVdL34vjj6h4KymfT7TLVd SicQ== X-Gm-Message-State: APjAAAVs5BSCIDVRpsv5iKIco/zY0s1/HSun9nVomiF7nVzb017G6I/d O2o5ldh7g1Y/qpG/bz5BdMWb5/eq1NHreZ8k3jpWbw== X-Google-Smtp-Source: APXvYqzEvYRl4JdN04/kzcJ2uF5OScJG5S3wPCBhvXOqW2r+dGq3Dogmu9u+CBV5mDp2ITVnET0Tes79njE3ovLLooQ= X-Received: by 2002:a05:620a:15c4:: with SMTP id o4mr71362902qkm.175.1555610645304; Thu, 18 Apr 2019 11:04:05 -0700 (PDT) MIME-Version: 1.0 References: <201904180332.x3I3WJTt096491@slippy.cwsent.com> <201904181345.x3IDjgr4005764@gndrsh.dnsmgr.net> In-Reply-To: From: Warner Losh Date: Thu, 18 Apr 2019 12:03:53 -0600 Message-ID: Subject: Re: svn commit: r346341 - head/tools/build To: Ed Maste Cc: Kyle Evans , "Rodney W. Grimes" , Cy Schubert , Cy Schubert , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: F0C0172B0B 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.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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: Thu, 18 Apr 2019 18:04:06 -0000 On Thu, Apr 18, 2019 at 12:03 PM Ed Maste wrote: > On Thu, 18 Apr 2019 at 10:03, Kyle Evans wrote: > > > > Keep in mind that this is bootstrap; it's being built for the host > > system, but it will link against a version of libcasper that's been > > built in an earlier stage with the proper featureset. > > Not exactly the case here: if building on a system with too-old Casper > then strings just builds without Capsicum/Casper support. Macros / > static inline stub implementations in the header takes care of this, > it does not actually link against any libcasper. > Yea, we need to do one or the other. Warner From owner-svn-src-head@freebsd.org Thu Apr 18 19:04:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 645571579E77; Thu, 18 Apr 2019 19:04:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 09DAA75155; Thu, 18 Apr 2019 19:04:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAC8423376; Thu, 18 Apr 2019 19:04:07 +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 x3IJ47Gp019686; Thu, 18 Apr 2019 19:04:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IJ47Qh019683; Thu, 18 Apr 2019 19:04:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904181904.x3IJ47Qh019683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Apr 2019 19:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346356 - in head: lib/libcuse sys/fs/cuse X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: lib/libcuse sys/fs/cuse X-SVN-Commit-Revision: 346356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09DAA75155 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.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 18 Apr 2019 19:04:08 -0000 Author: hselasky Date: Thu Apr 18 19:04:07 2019 New Revision: 346356 URL: https://svnweb.freebsd.org/changeset/base/346356 Log: Implement flag for telling cuse(3) clients if the peer is running in 32-bit compat mode or not. This is useful when implementing compatibility ioctl(2) handlers in userspace. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/lib/libcuse/cuse.3 head/sys/fs/cuse/cuse.c head/sys/fs/cuse/cuse_defs.h Modified: head/lib/libcuse/cuse.3 ============================================================================== --- head/lib/libcuse/cuse.3 Thu Apr 18 15:31:03 2019 (r346355) +++ head/lib/libcuse/cuse.3 Thu Apr 18 19:04:07 2019 (r346356) @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 5, 2017 +.Dd April 17, 2019 .Dt CUSE 3 .Os .Sh NAME @@ -303,6 +303,7 @@ enum { CUSE_FFLAG_READ CUSE_FFLAG_WRITE CUSE_FFLAG_NONBLOCK + CUSE_FFLAG_COMPAT32 CUSE_CMD_NONE CUSE_CMD_OPEN Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Thu Apr 18 15:31:03 2019 (r346355) +++ head/sys/fs/cuse/cuse.c Thu Apr 18 19:04:07 2019 (r346356) @@ -51,6 +51,7 @@ #include #include #include +#include #include @@ -536,7 +537,10 @@ cuse_client_send_command_locked(struct cuse_client_com if (ioflag & IO_NDELAY) cuse_fflags |= CUSE_FFLAG_NONBLOCK; - +#if defined(__LP64__) + if (SV_CURPROC_FLAG(SV_ILP32)) + cuse_fflags |= CUSE_FFLAG_COMPAT32; +#endif pccmd->sub.fflags = cuse_fflags; pccmd->sub.data_pointer = data_ptr; pccmd->sub.argument = arg; Modified: head/sys/fs/cuse/cuse_defs.h ============================================================================== --- head/sys/fs/cuse/cuse_defs.h Thu Apr 18 15:31:03 2019 (r346355) +++ head/sys/fs/cuse/cuse_defs.h Thu Apr 18 19:04:07 2019 (r346356) @@ -27,7 +27,7 @@ #ifndef _CUSE_DEFS_H_ #define _CUSE_DEFS_H_ -#define CUSE_VERSION 0x000123 +#define CUSE_VERSION 0x000124 #define CUSE_ERR_NONE 0 #define CUSE_ERR_BUSY -1 @@ -49,6 +49,7 @@ #define CUSE_FFLAG_READ 1 #define CUSE_FFLAG_WRITE 2 #define CUSE_FFLAG_NONBLOCK 4 +#define CUSE_FFLAG_COMPAT32 8 /* peer is running in 32-bit compat mode */ #define CUSE_DBG_NONE 0 #define CUSE_DBG_FULL 1 From owner-svn-src-head@freebsd.org Thu Apr 18 20:48:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D920157C22B; Thu, 18 Apr 2019 20:48:57 +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 D4C1D80766; Thu, 18 Apr 2019 20:48:56 +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 915B7244CC; Thu, 18 Apr 2019 20:48:56 +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 x3IKmutO073309; Thu, 18 Apr 2019 20:48:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IKmtG2073301; Thu, 18 Apr 2019 20:48:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904182048.x3IKmtG2073301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 18 Apr 2019 20:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346358 - in head: . sys/dev/random sys/libkern sys/mips/conf sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: . sys/dev/random sys/libkern sys/mips/conf sys/sys X-SVN-Commit-Revision: 346358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4C1D80766 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)[-1.000,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: Thu, 18 Apr 2019 20:48:57 -0000 Author: cem Date: Thu Apr 18 20:48:54 2019 New Revision: 346358 URL: https://svnweb.freebsd.org/changeset/base/346358 Log: random(4): Restore availability tradeoff prior to r346250 As discussed in that commit message, it is a dangerous default. But the safe default causes enough pain on a variety of platforms that for now, restore the prior default. Some of this is self-induced pain we should/could do better about; for example, programmatic CI systems and VM managers should introduce entropy from the host for individual VM instances. This is considered a future work item. On modern x86 and Power9 systems, this may be wholly unnecessary after D19928 lands (even in the non-ideal case where early /boot/entropy is unavailable), because they have fast hardware random sources available early in boot. But D19928 is not yet landed and we have a host of architectures which do not provide fast random sources. This change adds several tunables and diagnostic sysctls, documented thoroughly in UPDATING and sys/dev/random/random_infra.c. PR: 230875 (reopens) Reported by: adrian, jhb, imp, and probably others Reviewed by: delphij, imp (earlier version), markm (earlier version) Discussed with: adrian Approved by: secteam(delphij) Relnotes: yeah Security: related Differential Revision: https://reviews.freebsd.org/D19944 Modified: head/UPDATING head/sys/dev/random/random_infra.c head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/libkern/arc4random.c head/sys/mips/conf/PB92 head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Apr 18 19:16:34 2019 (r346357) +++ head/UPDATING Thu Apr 18 20:48:54 2019 (r346358) @@ -31,6 +31,30 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190418: + The following knobs have been added related to tradeoffs between + safe use of the random device and availability in the absence of + entropy: + + kern.random.initial_seeding.bypass_before_seeding: tunable; set + non-zero to bypass the random device prior to seeding, or zero to + block random requests until the random device is initially seeded. + For now, set to 1 (unsafe) by default to restore pre-r346250 boot + availability properties. + + kern.random.initial_seeding.read_random_bypassed_before_seeding: + read-only diagnostic sysctl that is set when bypass is enabled and + read_random(9) is bypassed, to enable programmatic handling of this + initial condition, if desired. + + kern.random.initial_seeding.arc4random_bypassed_before_seeding: + Similar to the above, but for for arc4random(9) initial seeding. + + kern.random.initial_seeding.disable_bypass_warnings: tunable; set + non-zero to disable warnings in dmesg when the same conditions are + met as for the diagnostic sysctls above. Defaults to zero, i.e., + produce warnings in dmesg when the conditions are met. + 20190416: The tunable "security.stack_protect.permit_nonrandom_cookies" may be set to a non-zero value to boot systems that do not provide early Modified: head/sys/dev/random/random_infra.c ============================================================================== --- head/sys/dev/random/random_infra.c Thu Apr 18 19:16:34 2019 (r346357) +++ head/sys/dev/random/random_infra.c Thu Apr 18 20:48:54 2019 (r346358) @@ -43,7 +43,61 @@ __FBSDID("$FreeBSD$"); #include /* Set up the sysctl root node for the entropy device */ -SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW, 0, "Cryptographically Secure Random Number Generator"); +SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW, 0, + "Cryptographically Secure Random Number Generator"); +SYSCTL_NODE(_kern_random, OID_AUTO, initial_seeding, CTLFLAG_RW, 0, + "Initial seeding control and information"); + +/* + * N.B., this is a dangerous default, but it matches the behavior prior to + * r346250 (and, say, OpenBSD -- although they get some guaranteed saved + * entropy from the prior boot because of their KARL system, on RW media). + */ +bool random_bypass_before_seeding = true; +SYSCTL_BOOL(_kern_random_initial_seeding, OID_AUTO, + bypass_before_seeding, CTLFLAG_RDTUN, &random_bypass_before_seeding, + 0, "If set non-zero, bypass the random device in requests for random " + "data when the random device is not yet seeded. This is considered " + "dangerous. Ordinarily, the random device will block requests until " + "it is seeded by sufficient entropy."); + +/* + * This is a read-only diagnostic that reports the combination of the former + * tunable and actual bypass. It is intended for programmatic inspection by + * userspace administrative utilities after boot. + */ +bool read_random_bypassed_before_seeding = false; +SYSCTL_BOOL(_kern_random_initial_seeding, OID_AUTO, + read_random_bypassed_before_seeding, CTLFLAG_RD, + &read_random_bypassed_before_seeding, 0, "If non-zero, the random device " + "was bypassed because the 'bypass_before_seeding' knob was enabled and a " + "request was submitted prior to initial seeding."); + +/* + * This is a read-only diagnostic that reports the combination of the former + * tunable and actual bypass for arc4random initial seeding. It is intended + * for programmatic inspection by userspace administrative utilities after + * boot. + */ +bool arc4random_bypassed_before_seeding = false; +SYSCTL_BOOL(_kern_random_initial_seeding, OID_AUTO, + arc4random_bypassed_before_seeding, CTLFLAG_RD, + &arc4random_bypassed_before_seeding, 0, "If non-zero, the random device " + "was bypassed when initially seeding the kernel arc4random(9), because " + "the 'bypass_before_seeding' knob was enabled and a request was submitted " + "prior to initial seeding."); + +/* + * This knob is for users who do not want additional warnings in their logs + * because they intend to handle bypass by inspecting the status of the + * diagnostic sysctls. + */ +bool random_bypass_disable_warnings = false; +SYSCTL_BOOL(_kern_random_initial_seeding, OID_AUTO, + disable_bypass_warnings, CTLFLAG_RDTUN, + &random_bypass_disable_warnings, 0, "If non-zero, do not log a warning " + "if the 'bypass_before_seeding' knob is enabled and a request is " + "submitted prior to initial seeding."); MALLOC_DEFINE(M_ENTROPY, "entropy", "Entropy harvesting buffers and data structures"); Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Thu Apr 18 19:16:34 2019 (r346357) +++ head/sys/dev/random/randomdev.c Thu Apr 18 20:48:54 2019 (r346358) @@ -236,11 +236,15 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) } /*- - * Kernel API version of read_random(). - * This is similar to random_alg_read(), - * except it doesn't interface with uio(9). - * It cannot assumed that random_buf is a multiple of - * RANDOM_BLOCKSIZE bytes. + * Kernel API version of read_random(). This is similar to read_random_uio(), + * except it doesn't interface with uio(9). It cannot assumed that random_buf + * is a multiple of RANDOM_BLOCKSIZE bytes. + * + * If the tunable 'kern.random.initial_seeding.bypass_before_seeding' is set + * non-zero, silently fail to emit random data (matching the pre-r346250 + * behavior). If read_random is called prior to seeding and bypassed because + * of this tunable, the condition is reported in the read-only sysctl + * 'kern.random.initial_seeding.read_random_bypassed_before_seeding'. */ void READ_RANDOM(void *random_buf, u_int len) @@ -249,12 +253,31 @@ READ_RANDOM(void *random_buf, u_int len) KASSERT(random_buf != NULL, ("No suitable random buffer in %s", __func__)); p_random_alg_context->ra_pre_read(); + + if (len == 0) + return; + /* (Un)Blocking logic */ - if (!p_random_alg_context->ra_seeded()) + if (__predict_false(!p_random_alg_context->ra_seeded())) { + if (random_bypass_before_seeding) { + if (!read_random_bypassed_before_seeding) { + if (!random_bypass_disable_warnings) + printf("read_random: WARNING: bypassing" + " request for random data because " + "the random device is not yet " + "seeded and the knob " + "'bypass_before_seeding' was " + "enabled.\n"); + read_random_bypassed_before_seeding = true; + } + /* Avoid potentially leaking stack garbage */ + memset(random_buf, 0, len); + return; + } + (void)randomdev_wait_until_seeded(SEEDWAIT_UNINTERRUPTIBLE); + } read_rate_increment(roundup2(len, sizeof(uint32_t))); - if (len == 0) - return; /* * The underlying generator expects multiples of * RANDOM_BLOCKSIZE. Modified: head/sys/dev/random/randomdev.h ============================================================================== --- head/sys/dev/random/randomdev.h Thu Apr 18 19:16:34 2019 (r346357) +++ head/sys/dev/random/randomdev.h Thu Apr 18 20:48:54 2019 (r346358) @@ -37,6 +37,7 @@ #ifdef SYSCTL_DECL /* from sysctl.h */ SYSCTL_DECL(_kern_random); +SYSCTL_DECL(_kern_random_initial_seeding); #define RANDOM_CHECK_UINT(name, min, max) \ static int \ @@ -54,6 +55,11 @@ random_check_uint_##name(SYSCTL_HANDLER_ARGS) \ #endif /* SYSCTL_DECL */ MALLOC_DECLARE(M_ENTROPY); + +extern bool random_bypass_before_seeding; +extern bool read_random_bypassed_before_seeding; +extern bool arc4random_bypassed_before_seeding; +extern bool random_bypass_disable_warnings; #endif /* _KERNEL */ Modified: head/sys/libkern/arc4random.c ============================================================================== --- head/sys/libkern/arc4random.c Thu Apr 18 19:16:34 2019 (r346357) +++ head/sys/libkern/arc4random.c Thu Apr 18 20:48:54 2019 (r346358) @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #define CHACHA20_RESEED_BYTES 65536 #define CHACHA20_RESEED_SECONDS 300 @@ -77,12 +80,43 @@ chacha20_randomstir(struct chacha20_s *chacha20) struct timeval tv_now; u_int8_t key[CHACHA20_KEYBYTES]; - /* - * If the loader(8) did not have an entropy stash from the previous - * shutdown to load, then we will block. The answer is to make sure - * there is an entropy stash at shutdown time. - */ - read_random(key, CHACHA20_KEYBYTES); + if (__predict_false(random_bypass_before_seeding && !is_random_seeded())) { + SHA256_CTX ctx; + uint64_t cc; + uint32_t fver; + + if (!arc4random_bypassed_before_seeding) { + arc4random_bypassed_before_seeding = true; + if (!random_bypass_disable_warnings) + printf("arc4random: WARNING: initial seeding " + "bypassed the cryptographic random device " + "because it was not yet seeded and the " + "knob 'bypass_before_seeding' was " + "enabled.\n"); + } + + /* Last ditch effort to inject something in a bad condition. */ + cc = get_cyclecount(); + SHA256_Init(&ctx); + SHA256_Update(&ctx, key, sizeof(key)); + SHA256_Update(&ctx, &cc, sizeof(cc)); + fver = __FreeBSD_version; + SHA256_Update(&ctx, &fver, sizeof(fver)); + _Static_assert(sizeof(key) == SHA256_DIGEST_LENGTH, + "make sure 256 bits is still 256 bits"); + SHA256_Final(key, &ctx); + } else { + /* + * If the loader(8) did not have an entropy stash from the + * previous shutdown to load, then we will block. The answer is + * to make sure there is an entropy stash at shutdown time. + * + * On the other hand, if the random_bypass_before_seeding knob + * was set and we landed in this branch, we know this won't + * block because we know the random device is seeded. + */ + read_random(key, CHACHA20_KEYBYTES); + } getmicrouptime(&tv_now); mtx_lock(&chacha20->mtx); chacha_keysetup(&chacha20->ctx, key, CHACHA20_KEYBYTES*8); Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Thu Apr 18 19:16:34 2019 (r346357) +++ head/sys/mips/conf/PB92 Thu Apr 18 20:48:54 2019 (r346358) @@ -133,5 +133,5 @@ device loop device ether #device md #device bpf -#device random +device random #device if_bridge Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Apr 18 19:16:34 2019 (r346357) +++ head/sys/sys/param.h Thu Apr 18 20:48:54 2019 (r346358) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300019 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300020 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Apr 18 22:52:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A0C157E9C1; Thu, 18 Apr 2019 22:52:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 DECBA84285; Thu, 18 Apr 2019 22:52:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA94C25AC4; Thu, 18 Apr 2019 22:52:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3IMqCMI040414; Thu, 18 Apr 2019 22:52:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3IMqC53040413; Thu, 18 Apr 2019 22:52:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904182252.x3IMqC53040413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 18 Apr 2019 22:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346359 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 346359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DECBA84285 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)[-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, 18 Apr 2019 22:52:13 -0000 Author: imp Date: Thu Apr 18 22:52:12 2019 New Revision: 346359 URL: https://svnweb.freebsd.org/changeset/base/346359 Log: When parsing command line stuff, treat tabs and spaces the same. When creating complex config files, people like to use tabs to offset sections. Treat them the same as spaces for delimiters. Modified: head/sys/kern/subr_boot.c Modified: head/sys/kern/subr_boot.c ============================================================================== --- head/sys/kern/subr_boot.c Thu Apr 18 20:48:54 2019 (r346358) +++ head/sys/kern/subr_boot.c Thu Apr 18 22:52:12 2019 (r346359) @@ -199,13 +199,13 @@ boot_parse_cmdline_delim(char *cmdline, const char *de } /** - * @brief Simplified interface for common 'space separated' args + * @brief Simplified interface for common 'space or tab separated' args */ int boot_parse_cmdline(char *cmdline) { - return (boot_parse_cmdline_delim(cmdline, " \n")); + return (boot_parse_cmdline_delim(cmdline, " \t\n")); } /** From owner-svn-src-head@freebsd.org Thu Apr 18 23:21:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C592157F205; Thu, 18 Apr 2019 23:21:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 9FACD84FEF; Thu, 18 Apr 2019 23:21:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8615F25FA4; Thu, 18 Apr 2019 23:21:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3INLQK0054164; Thu, 18 Apr 2019 23:21:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3INLQYs054163; Thu, 18 Apr 2019 23:21:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904182321.x3INLQYs054163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 18 Apr 2019 23:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346360 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 346360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FACD84FEF 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)[-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, 18 Apr 2019 23:21:27 -0000 Author: jhb Date: Thu Apr 18 23:21:26 2019 New Revision: 346360 URL: https://svnweb.freebsd.org/changeset/base/346360 Log: Push down INP_WLOCK slightly in tcp_ctloutput. The inp lock is not needed for testing the V6 flag as that flag is set once when the inp is created and never changes. For non-TCP socket options the lock is immediately dropped after checking that flag. This just pushes the lock down to only be acquired for TCP socket options. This isn't a hot-path, more a cosmetic cleanup I noticed while reading the code. Reviewed by: bz MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19740 Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Thu Apr 18 22:52:12 2019 (r346359) +++ head/sys/netinet/tcp_usrreq.c Thu Apr 18 23:21:26 2019 (r346360) @@ -1578,11 +1578,9 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt) error = 0; inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_ctloutput: inp == NULL")); - INP_WLOCK(inp); if (sopt->sopt_level != IPPROTO_TCP) { #ifdef INET6 if (inp->inp_vflag & INP_IPV6PROTO) { - INP_WUNLOCK(inp); error = ip6_ctloutput(so, sopt); /* * In case of the IPV6_USE_MIN_MTU socket option, @@ -1627,12 +1625,12 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt) #endif #ifdef INET { - INP_WUNLOCK(inp); error = ip_ctloutput(so, sopt); } #endif return (error); } + INP_WLOCK(inp); if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { INP_WUNLOCK(inp); return (ECONNRESET); From owner-svn-src-head@freebsd.org Fri Apr 19 02:28:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B85C1582898; Fri, 19 Apr 2019 02:28:05 +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 3950D897A8; Fri, 19 Apr 2019 02:28:05 +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 1138727E4E; Fri, 19 Apr 2019 02:28:05 +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 x3J2S4bL050208; Fri, 19 Apr 2019 02:28:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3J2S4LV050207; Fri, 19 Apr 2019 02:28:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904190228.x3J2S4LV050207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 19 Apr 2019 02:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346363 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 346363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3950D897A8 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.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 19 Apr 2019 02:28:05 -0000 Author: jhibbits Date: Fri Apr 19 02:28:04 2019 New Revision: 346363 URL: https://svnweb.freebsd.org/changeset/base/346363 Log: powerpc/powernv: Make erasing before writes optional If the OPAL flash driver supports writing without erase, it adds a 'no-erase' property to the flash device node. Honor that property and don't bother erasing if it exists. Modified: head/sys/powerpc/powernv/opal_flash.c Modified: head/sys/powerpc/powernv/opal_flash.c ============================================================================== --- head/sys/powerpc/powernv/opal_flash.c Fri Apr 19 00:32:13 2019 (r346362) +++ head/sys/powerpc/powernv/opal_flash.c Fri Apr 19 02:28:04 2019 (r346363) @@ -69,6 +69,7 @@ struct opalflash_softc { struct proc *sc_p; struct bio_queue_head sc_bio_queue; int sc_opal_id; + bool sc_erase; /* Erase is needed before write. */ }; #define OPALFLASH_LOCK(sc) mtx_lock(&(sc)->sc_mtx) @@ -242,10 +243,12 @@ opalflash_write(struct opalflash_softc *sc, off_t off, count % sc->sc_disk->d_stripesize != 0) return (EIO); - /* Erase the full block first, then write in page chunks. */ - rv = opalflash_erase(sc, off, count); - if (rv != 0) - return (rv); + if (sc->sc_erase) { + /* Erase the full block first, then write in page chunks. */ + rv = opalflash_erase(sc, off, count); + if (rv != 0) + return (rv); + } token = opal_alloc_async_token(); @@ -354,6 +357,9 @@ opalflash_attach(device_t dev) device_printf(dev, "Cannot determine flash block size.\n"); return (ENXIO); } + + if (!OF_hasprop(node, "no-erase")) + sc->sc_erase = true; OPALFLASH_LOCK_INIT(sc); From owner-svn-src-head@freebsd.org Fri Apr 19 02:54:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACD311582F88; Fri, 19 Apr 2019 02:54:16 +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 57EF78A294; Fri, 19 Apr 2019 02:54:16 +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 304732835E; Fri, 19 Apr 2019 02:54:16 +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 x3J2sFem065810; Fri, 19 Apr 2019 02:54:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3J2sDUh065797; Fri, 19 Apr 2019 02:54:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201904190254.x3J2sDUh065797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 19 Apr 2019 02:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346364 - in head: sys/contrib/zstd sys/contrib/zstd/contrib/docker sys/contrib/zstd/contrib/experimental_dict_builders sys/contrib/zstd/contrib/largeNbDicts sys/contrib/zstd/contrib/pr... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/contrib/zstd sys/contrib/zstd/contrib/docker sys/contrib/zstd/contrib/experimental_dict_builders sys/contrib/zstd/contrib/largeNbDicts sys/contrib/zstd/contrib/premake sys/contrib/zstd/co... X-SVN-Commit-Revision: 346364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 57EF78A294 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]; NEURAL_HAM_LONG(-1.00)[-1.000,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, 19 Apr 2019 02:54:17 -0000 Author: cem Date: Fri Apr 19 02:54:13 2019 New Revision: 346364 URL: https://svnweb.freebsd.org/changeset/base/346364 Log: Update to Zstandard 1.4.0 The full release notes can be found on Github: https://github.com/facebook/zstd/releases/tag/v1.4.0 Relnotes: yes Added: head/sys/contrib/zstd/CHANGELOG - copied unchanged from r346362, vendor/zstd/dist/CHANGELOG head/sys/contrib/zstd/contrib/docker/ - copied from r346362, vendor/zstd/dist/contrib/docker/ head/sys/contrib/zstd/contrib/experimental_dict_builders/ - copied from r346362, vendor/zstd/dist/contrib/experimental_dict_builders/ head/sys/contrib/zstd/contrib/largeNbDicts/ - copied from r346362, vendor/zstd/dist/contrib/largeNbDicts/ head/sys/contrib/zstd/contrib/premake/ - copied from r346362, vendor/zstd/dist/contrib/premake/ head/sys/contrib/zstd/contrib/snap/ - copied from r346362, vendor/zstd/dist/contrib/snap/ head/sys/contrib/zstd/examples/ - copied from r346362, vendor/zstd/dist/examples/ head/sys/contrib/zstd/programs/timefn.c - copied unchanged from r346362, vendor/zstd/dist/programs/timefn.c head/sys/contrib/zstd/programs/timefn.h - copied unchanged from r346362, vendor/zstd/dist/programs/timefn.h head/sys/contrib/zstd/tests/fuzz/dictionary_decompress.c - copied unchanged from r346362, vendor/zstd/dist/tests/fuzz/dictionary_decompress.c head/sys/contrib/zstd/tests/fuzz/dictionary_round_trip.c - copied unchanged from r346362, vendor/zstd/dist/tests/fuzz/dictionary_round_trip.c Modified: head/sys/contrib/zstd/Makefile head/sys/contrib/zstd/README.md head/sys/contrib/zstd/contrib/pzstd/Makefile head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp head/sys/contrib/zstd/contrib/pzstd/utils/Range.h head/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h head/sys/contrib/zstd/doc/README.md head/sys/contrib/zstd/doc/educational_decoder/Makefile head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/lib/Makefile head/sys/contrib/zstd/lib/README.md head/sys/contrib/zstd/lib/common/compiler.h head/sys/contrib/zstd/lib/common/fse.h head/sys/contrib/zstd/lib/common/threading.c head/sys/contrib/zstd/lib/common/xxhash.c head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/fse_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_fast.c head/sys/contrib/zstd/lib/compress/zstd_lazy.h head/sys/contrib/zstd/lib/compress/zstd_ldm.c head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/zstd_ddict.c head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_internal.h head/sys/contrib/zstd/lib/dictBuilder/cover.c head/sys/contrib/zstd/lib/dictBuilder/cover.h head/sys/contrib/zstd/lib/dictBuilder/fastcover.c head/sys/contrib/zstd/lib/dictBuilder/zdict.h head/sys/contrib/zstd/lib/legacy/zstd_legacy.h head/sys/contrib/zstd/lib/legacy/zstd_v01.c head/sys/contrib/zstd/lib/legacy/zstd_v01.h head/sys/contrib/zstd/lib/legacy/zstd_v02.c head/sys/contrib/zstd/lib/legacy/zstd_v02.h head/sys/contrib/zstd/lib/legacy/zstd_v03.c head/sys/contrib/zstd/lib/legacy/zstd_v03.h head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v04.h head/sys/contrib/zstd/lib/legacy/zstd_v05.c head/sys/contrib/zstd/lib/legacy/zstd_v05.h head/sys/contrib/zstd/lib/legacy/zstd_v06.c head/sys/contrib/zstd/lib/legacy/zstd_v06.h head/sys/contrib/zstd/lib/legacy/zstd_v07.c head/sys/contrib/zstd/lib/legacy/zstd_v07.h head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/Makefile head/sys/contrib/zstd/programs/benchfn.c head/sys/contrib/zstd/programs/benchfn.h head/sys/contrib/zstd/programs/benchzstd.c head/sys/contrib/zstd/programs/benchzstd.h 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.c 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/tests/Makefile head/sys/contrib/zstd/tests/README.md 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/README.md head/sys/contrib/zstd/tests/fuzz/fuzz.py head/sys/contrib/zstd/tests/fuzz/fuzz_helpers.h head/sys/contrib/zstd/tests/fuzz/regression_driver.c head/sys/contrib/zstd/tests/fuzz/simple_round_trip.c head/sys/contrib/zstd/tests/fuzz/stream_decompress.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/fuzz/zstd_helpers.h head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/legacy.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/regression/config.c head/sys/contrib/zstd/tests/regression/method.c head/sys/contrib/zstd/tests/regression/results.csv head/sys/contrib/zstd/tests/regression/test.c head/sys/contrib/zstd/tests/roundTripCrash.c head/sys/contrib/zstd/tests/symbols.c head/sys/contrib/zstd/tests/zbufftest.c head/sys/contrib/zstd/tests/zstreamtest.c head/sys/contrib/zstd/zlibWrapper/Makefile head/sys/contrib/zstd/zlibWrapper/README.md head/sys/contrib/zstd/zlibWrapper/examples/fitblk.c head/sys/contrib/zstd/zlibWrapper/examples/fitblk_original.c head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/sys/contrib/zstd/zlibWrapper/gzguts.h head/usr.bin/zstd/Makefile Directory Properties: head/sys/contrib/zstd/ (props changed) Copied: head/sys/contrib/zstd/CHANGELOG (from r346362, vendor/zstd/dist/CHANGELOG) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/CHANGELOG Fri Apr 19 02:54:13 2019 (r346364, copy of r346362, vendor/zstd/dist/CHANGELOG) @@ -0,0 +1,461 @@ +v1.4.0 +perf: Improve level 1 compression speed in most scenarios by 6% by @gbtucker and @terrelln +api: Move the advanced API, including all functions in the staging section, to the stable section +api: Make ZSTD_e_flush and ZSTD_e_end block for maximum forward progress +api: Rename ZSTD_CCtxParam_getParameter to ZSTD_CCtxParams_getParameter +api: Rename ZSTD_CCtxParam_setParameter to ZSTD_CCtxParams_setParameter +api: Don't export ZSTDMT functions from the shared library by default +api: Require ZSTD_MULTITHREAD to be defined to use ZSTDMT +api: Add ZSTD_decompressBound() to provide an upper bound on decompressed size by @shakeelrao +api: Fix ZSTD_decompressDCtx() corner cases with a dictionary +api: Move ZSTD_getDictID_*() functions to the stable section +api: Add ZSTD_c_literalCompressionMode flag to enable or disable literal compression by @terrelln +api: Allow compression parameters to be set when a dictionary is used +api: Allow setting parameters before or after ZSTD_CCtx_loadDictionary() is called +api: Fix ZSTD_estimateCStreamSize_usingCCtxParams() +api: Setting ZSTD_d_maxWindowLog to 0 means use the default +cli: Ensure that a dictionary is not used to compress itself by @shakeelrao +cli: Add --[no-]compress-literals flag to enable or disable literal compression +doc: Update the examples to use the advanced API +doc: Explain how to transition from old streaming functions to the advanced API in the header +build: Improve the Windows release packages +build: Improve CMake build by @hjmjohnson +build: Build fixes for FreeBSD by @lwhsu +build: Remove redundant warnings by @thatsafunnyname +build: Fix tests on OpenBSD by @bket +build: Extend fuzzer build system to work with the new clang engine +build: CMake now creates the libzstd.so.1 symlink +build: Improve Menson build by @lzutao +misc: Fix symbolic link detection on FreeBSD +misc: Use physical core count for -T0 on FreeBSD by @cemeyer +misc: Fix zstd --list on truncated files by @kostmo +misc: Improve logging in debug mode by @felixhandte +misc: Add CirrusCI tests by @lwhsu +misc: Optimize dictionary memory usage in corner cases +misc: Improve the dictionary builder on small or homogeneous data +misc: Fix spelling across the repo by @jsoref + +v1.3.8 +perf: better decompression speed on large files (+7%) and cold dictionaries (+15%) +perf: slightly better compression ratio at high compression modes +api : finalized advanced API, last stage before "stable" status +api : new --rsyncable mode, by @terrelln +api : support decompression of empty frames into NULL (used to be an error) (#1385) +build: new set of macros to build a minimal size decoder, by @felixhandte +build: fix compilation on MIPS32, reported by @clbr (#1441) +build: fix compilation with multiple -arch flags, by @ryandesign +build: highly upgraded meson build, by @lzutao +build: improved buck support, by @obelisk +build: fix cmake script : can create debug build, by @pitrou +build: Makefile : grep works on both colored consoles and systems without color support +build: fixed zstd-pgo, by @bmwiedemann +cli : support ZSTD_CLEVEL environment variable, by @yijinfb (#1423) +cli : --no-progress flag, preserving final summary (#1371), by @terrelln +cli : ensure destination file is not source file (#1422) +cli : clearer error messages, especially when input file not present +doc : clarified zstd_compression_format.md, by @ulikunitz +misc: fixed zstdgrep, returns 1 on failure, by @lzutao +misc: NEWS renamed as CHANGELOG, in accordance with fboss + +v1.3.7 +perf: slightly better decompression speed on clang (depending on hardware target) +fix : performance of dictionary compression for small input < 4 KB at levels 9 and 10 +build: no longer build backtrace by default in release mode; restrict further automatic mode +build: control backtrace support through build macro BACKTRACE +misc: added man pages for zstdless and zstdgrep, by @samrussell + +v1.3.6 +perf: much faster dictionary builder, by @jenniferliu +perf: faster dictionary compression on small data when using multiple contexts, by @felixhandte +perf: faster dictionary decompression when using a very large number of dictionaries simultaneously +cli : fix : does no longer overwrite destination when source does not exist (#1082) +cli : new command --adapt, for automatic compression level adaptation +api : fix : block api can be streamed with > 4 GB, reported by @catid +api : reduced ZSTD_DDict size by 2 KB +api : minimum negative compression level is defined, and can be queried using ZSTD_minCLevel(). +build: support Haiku target, by @korli +build: Read Legacy format is limited to v0.5+ by default. Can be changed at compile time with macro ZSTD_LEGACY_SUPPORT. +doc : zstd_compression_format.md updated to match wording in IETF RFC 8478 +misc: tests/paramgrill, a parameter optimizer, by @GeorgeLu97 + +v1.3.5 +perf: much faster dictionary compression, by @felixhandte +perf: small quality improvement for dictionary generation, by @terrelln +perf: slightly improved high compression levels (notably level 19) +mem : automatic memory release for long duration contexts +cli : fix : overlapLog can be manually set +cli : fix : decoding invalid lz4 frames +api : fix : performance degradation for dictionary compression when using advanced API, by @terrelln +api : change : clarify ZSTD_CCtx_reset() vs ZSTD_CCtx_resetParameters(), by @terrelln +build: select custom libzstd scope through control macros, by @GeorgeLu97 +build: OpenBSD patch, by @bket +build: make and make all are compatible with -j +doc : clarify zstd_compression_format.md, updated for IETF RFC process +misc: pzstd compatible with reproducible compilation, by @lamby + +v1.3.4 +perf: faster speed (especially decoding speed) on recent cpus (haswell+) +perf: much better performance associating --long with multi-threading, by @terrelln +perf: better compression at levels 13-15 +cli : asynchronous compression by default, for faster experience (use --single-thread for former behavior) +cli : smoother status report in multi-threading mode +cli : added command --fast=#, for faster compression modes +cli : fix crash when not overwriting existing files, by Pádraig Brady (@pixelb) +api : `nbThreads` becomes `nbWorkers` : 1 triggers asynchronous mode +api : compression levels can be negative, for even more speed +api : ZSTD_getFrameProgression() : get precise progress status of ZSTDMT anytime +api : ZSTDMT can accept new compression parameters during compression +api : implemented all advanced dictionary decompression prototypes +build: improved meson recipe, by Shawn Landden (@shawnl) +build: VS2017 scripts, by @HaydnTrigg +misc: all /contrib projects fixed +misc: added /contrib/docker script by @gyscos + +v1.3.3 +perf: faster zstd_opt strategy (levels 16-19) +fix : bug #944 : multithreading with shared ditionary and large data, reported by @gsliepen +cli : fix : content size written in header by default +cli : fix : improved LZ4 format support, by @felixhandte +cli : new : hidden command `-S`, to benchmark multiple files while generating one result per file +api : fix : support large skippable frames, by @terrelln +api : fix : streaming interface was adding a useless 3-bytes null block to small frames +api : change : when setting `pledgedSrcSize`, use `ZSTD_CONTENTSIZE_UNKNOWN` macro value to mean "unknown" +build: fix : compilation under rhel6 and centos6, reported by @pixelb +build: added `check` target + +v1.3.2 +new : long range mode, using --long command, by Stella Lau (@stellamplau) +new : ability to generate and decode magicless frames (#591) +changed : maximum nb of threads reduced to 200, to avoid address space exhaustion in 32-bits mode +fix : multi-threading compression works with custom allocators +fix : ZSTD_sizeof_CStream() was over-evaluating memory usage +fix : a rare compression bug when compression generates very large distances and bunch of other conditions (only possible at --ultra -22) +fix : 32-bits build can now decode large offsets (levels 21+) +cli : added LZ4 frame support by default, by Felix Handte (@felixhandte) +cli : improved --list output +cli : new : can split input file for dictionary training, using command -B# +cli : new : clean operation artefact on Ctrl-C interruption +cli : fix : do not change /dev/null permissions when using command -t with root access, reported by @mike155 (#851) +cli : fix : write file size in header in multiple-files mode +api : added macro ZSTD_COMPRESSBOUND() for static allocation +api : experimental : new advanced decompression API +api : fix : sizeof_CCtx() used to over-estimate +build: fix : no-multithread variant compiles without pool.c dependency, reported by Mitchell Blank Jr (@mitchblank) (#819) +build: better compatibility with reproducible builds, by Bernhard M. Wiedemann (@bmwiedemann) (#818) +example : added streaming_memory_usage +license : changed /examples license to BSD + GPLv2 +license : fix a few header files to reflect new license (#825) + +v1.3.1 +New license : BSD + GPLv2 +perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) +perf: Multi-threading supports up to 256 threads. Cap at 256 when more are requested (#760) +cli : improved and fixed --list command, by @ib (#772) +cli : command -vV to list supported formats, by @ib (#771) +build : fixed binary variants, reported by @svenha (#788) +build : fix Visual compilation for non x86/x64 targets, reported by Greg Slazinski (@GregSlazinski) (#718) +API exp : breaking change : ZSTD_getframeHeader() provides more information +API exp : breaking change : pinned down values of error codes +doc : fixed huffman example, by Ulrich Kunitz (@ulikunitz) +new : contrib/adaptive-compression, I/O driven compression strength, by Paul Cruz (@paulcruz74) +new : contrib/long_distance_matching, statistics by Stella Lau (@stellamplau) +updated : contrib/linux-kernel, by Nick Terrell (@terrelln) + +v1.3.0 +cli : new : `--list` command, by Paul Cruz +cli : changed : xz/lzma support enabled by default +cli : changed : `-t *` continue processing list after a decompression error +API : added : ZSTD_versionString() +API : promoted to stable status : ZSTD_getFrameContentSize(), by Sean Purcell +API exp : new advanced API : ZSTD_compress_generic(), ZSTD_CCtx_setParameter() +API exp : new : API for static or external allocation : ZSTD_initStatic?Ctx() +API exp : added : ZSTD_decompressBegin_usingDDict(), requested by Guy Riddle (#700) +API exp : clarified memory estimation / measurement functions. +API exp : changed : strongest strategy renamed ZSTD_btultra, fastest strategy ZSTD_fast set to 1 +tools : decodecorpus can generate random dictionary-compressed samples, by Paul Cruz +new : contrib/seekable_format, demo and API, by Sean Purcell +changed : contrib/linux-kernel, updated version and license, by Nick Terrell + +v1.2.0 +cli : changed : Multithreading enabled by default (use target zstd-nomt or HAVE_THREAD=0 to disable) +cli : new : command -T0 means "detect and use nb of cores", by Sean Purcell +cli : new : zstdmt symlink hardwired to `zstd -T0` +cli : new : command --threads=# (#671) +cli : changed : cover dictionary builder by default, for improved quality, by Nick Terrell +cli : new : commands --train-cover and --train-legacy, to select dictionary algorithm and parameters +cli : experimental targets `zstd4` and `xzstd4`, with support for lz4 format, by Sean Purcell +cli : fix : does not output compressed data on console +cli : fix : ignore symbolic links unless --force specified, +API : breaking change : ZSTD_createCDict_advanced(), only use compressionParameters as argument +API : added : prototypes ZSTD_*_usingCDict_advanced(), for direct control over frameParameters. +API : improved: ZSTDMT_compressCCtx() reduced memory usage +API : fix : ZSTDMT_compressCCtx() now provides srcSize in header (#634) +API : fix : src size stored in frame header is controlled at end of frame +API : fix : enforced consistent rules for pledgedSrcSize==0 (#641) +API : fix : error code "GENERIC" replaced by "dstSizeTooSmall" when appropriate +build: improved cmake script, by @Majlen +build: enabled Multi-threading support for *BSD, by Baptiste Daroussin +tools: updated Paramgrill. Command -O# provides best parameters for sample and speed target. +new : contrib/linux-kernel version, by Nick Terrell + +v1.1.4 +cli : new : can compress in *.gz format, using --format=gzip command, by Przemyslaw Skibinski +cli : new : advanced benchmark command --priority=rt +cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77 +cli : fix : --rm remains silent when input is stdin +cli : experimental : xzstd, with support for xz/lzma decoding, by Przemyslaw Skibinski +speed : improved decompression speed in streaming mode for single shot scenarios (+5%) +memory: DDict (decompression dictionary) memory usage down from 150 KB to 20 KB +arch: 32-bits variant able to generate and decode very long matches (>32 MB), by Sean Purcell +API : new : ZSTD_findFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize() +API : changed : dropped support of legacy versions <= v0.3 (can be changed by modifying ZSTD_LEGACY_SUPPORT value) +build : new: meson build system in contrib/meson, by Dima Krasner +build : improved cmake script, by @Majlen +build : added -Wformat-security flag, as recommended by Padraig Brady +doc : new : educational decoder, by Sean Purcell + +v1.1.3 +cli : zstd can decompress .gz files (can be disabled with `make zstd-nogz` or `make HAVE_ZLIB=0`) +cli : new : experimental target `make zstdmt`, with multi-threading support +cli : new : improved dictionary builder "cover" (experimental), by Nick Terrell, based on prior work by Giuseppe Ottaviano. +cli : new : advanced commands for detailed parameters, by Przemyslaw Skibinski +cli : fix zstdless on Mac OS-X, by Andrew Janke +cli : fix #232 "compress non-files" +dictBuilder : improved dictionary generation quality, thanks to Nick Terrell +API : new : lib/compress/ZSTDMT_compress.h multithreading API (experimental) +API : new : ZSTD_create?Dict_byReference(), requested by Bartosz Taudul +API : new : ZDICT_finalizeDictionary() +API : fix : ZSTD_initCStream_usingCDict() properly writes dictID into frame header, by Gregory Szorc (#511) +API : fix : all symbols properly exposed in libzstd, by Nick Terrell +build : support for Solaris target, by Przemyslaw Skibinski +doc : clarified specification, by Sean Purcell + +v1.1.2 +API : streaming : decompression : changed : automatic implicit reset when chain-decoding new frames without init +API : experimental : added : dictID retrieval functions, and ZSTD_initCStream_srcSize() +API : zbuff : changed : prototypes now generate deprecation warnings +lib : improved : faster decompression speed at ultra compression settings and 32-bits mode +lib : changed : only public ZSTD_ symbols are now exposed +lib : changed : reduced usage of stack memory +lib : fixed : several corner case bugs, by Nick Terrell +cli : new : gzstd, experimental version able to decode .gz files, by Przemyslaw Skibinski +cli : new : preserve file attributes +cli : new : added zstdless and zstdgrep tools +cli : fixed : status displays total amount decoded, even for file consisting of multiple frames (like pzstd) +cli : fixed : zstdcat +zlib_wrapper : added support for gz* functions, by Przemyslaw Skibinski +install : better compatibility with FreeBSD, by Dimitry Andric +source tree : changed : zbuff source files moved to lib/deprecated + +v1.1.1 +New : command -M#, --memory=, --memlimit=, --memlimit-decompress= to limit allowed memory consumption +New : doc/zstd_manual.html, by Przemyslaw Skibinski +Improved : slightly better compression ratio at --ultra levels (>= 20) +Improved : better memory usage when using streaming compression API, thanks to @Rogier-5 report +Added : API : ZSTD_initCStream_usingCDict(), ZSTD_initDStream_usingDDict() (experimental section) +Added : example/multiple_streaming_compression.c +Changed : zstd_errors.h is now installed within /include (and replaces errors_public.h) +Updated man page +Fixed : zstd-small, zstd-compress and zstd-decompress compilation targets + +v1.1.0 +New : contrib/pzstd, parallel version of zstd, by Nick Terrell +added : NetBSD install target (#338) +Improved : speed for batches of small files +Improved : speed of zlib wrapper, by Przemyslaw Skibinski +Changed : libzstd on Windows supports legacy formats, by Christophe Chevalier +Fixed : CLI -d output to stdout by default when input is stdin (#322) +Fixed : CLI correctly detects console on Mac OS-X +Fixed : CLI supports recursive mode `-r` on Mac OS-X +Fixed : Legacy decoders use unified error codes, reported by benrg (#341), fixed by Przemyslaw Skibinski +Fixed : compatibility with OpenBSD, reported by Juan Francisco Cantero Hurtado (#319) +Fixed : compatibility with Hurd, by Przemyslaw Skibinski (#365) +Fixed : zstd-pgo, reported by octoploid (#329) + +v1.0.0 +Change Licensing, all project is now BSD, Copyright Facebook +Small decompression speed improvement +API : Streaming API supports legacy format +API : ZDICT_getDictID(), ZSTD_sizeof_{CCtx, DCtx, CStream, DStream}(), ZSTD_setDStreamParameter() +CLI supports legacy formats v0.4+ +Fixed : compression fails on certain huge files, reported by Jesse McGrew +Enhanced documentation, by Przemyslaw Skibinski + +v0.8.1 +New streaming API +Changed : --ultra now enables levels beyond 19 +Changed : -i# now selects benchmark time in second +Fixed : ZSTD_compress* can now compress > 4 GB in a single pass, reported by Nick Terrell +Fixed : speed regression on specific patterns (#272) +Fixed : support for Z_SYNC_FLUSH, by Dmitry Krot (#291) +Fixed : ICC compilation, by Przemyslaw Skibinski + +v0.8.0 +Improved : better speed on clang and gcc -O2, thanks to Eric Biggers +New : Build on FreeBSD and DragonFly, thanks to JrMarino +Changed : modified API : ZSTD_compressEnd() +Fixed : legacy mode with ZSTD_HEAPMODE=0, by Christopher Bergqvist +Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers +Fixed : large dictionaries (> 384 KB), reported by Ilona Papava +Fixed : checksum correctly checked in single-pass mode +Fixed : combined --test amd --rm, reported by Andreas M. Nilsson +Modified : minor compression level adaptations +Updated : compression format specification to v0.2.0 +changed : zstd.h moved to /lib directory + +v0.7.5 +Transition version, supporting decoding of v0.8.x + +v0.7.4 +Added : homebrew for Mac, by Daniel Cade +Added : more examples +Fixed : segfault when using small dictionaries, reported by Felix Handte +Modified : default compression level for CLI is now 3 +Updated : specification, to v0.1.1 + +v0.7.3 +New : compression format specification +New : `--` separator, stating that all following arguments are file names. Suggested by Chip Turner. +New : `ZSTD_getDecompressedSize()` +New : OpenBSD target, by Juan Francisco Cantero Hurtado +New : `examples` directory +fixed : dictBuilder using HC levels, reported by Bartosz Taudul +fixed : legacy support from ZSTD_decompress_usingDDict(), reported by Felix Handte +fixed : multi-blocks decoding with intermediate uncompressed blocks, reported by Greg Slazinski +modified : removed "mem.h" and "error_public.h" dependencies from "zstd.h" (experimental section) +modified : legacy functions no longer need magic number + +v0.7.2 +fixed : ZSTD_decompressBlock() using multiple consecutive blocks. Reported by Greg Slazinski. +fixed : potential segfault on very large files (many gigabytes). Reported by Chip Turner. +fixed : CLI displays system error message when destination file cannot be created (#231). Reported by Chip Turner. + +v0.7.1 +fixed : ZBUFF_compressEnd() called multiple times with too small `dst` buffer, reported by Christophe Chevalier +fixed : dictBuilder fails if first sample is too small, reported by Руслан Ковалёв +fixed : corruption issue, reported by cj +modified : checksum enabled by default in command line mode + +v0.7.0 +New : Support for directory compression, using `-r`, thanks to Przemyslaw Skibinski +New : Command `--rm`, to remove source file after successful de/compression +New : Visual build scripts, by Christophe Chevalier +New : Support for Sparse File-systems (do not use space for zero-filled sectors) +New : Frame checksum support +New : Support pass-through mode (when using `-df`) +API : more efficient Dictionary API : `ZSTD_compress_usingCDict()`, `ZSTD_decompress_usingDDict()` +API : create dictionary files from custom content, by Giuseppe Ottaviano +API : support for custom malloc/free functions +New : controllable Dictionary ID +New : Support for skippable frames + +v0.6.1 +New : zlib wrapper API, thanks to Przemyslaw Skibinski +New : Ability to compile compressor / decompressor separately +Changed : new lib directory structure +Fixed : Legacy codec v0.5 compatible with dictionary decompression +Fixed : Decoder corruption error (#173) +Fixed : null-string roundtrip (#176) +New : benchmark mode can select directory as input +Experimental : midipix support, VMS support + +v0.6.0 +Stronger high compression modes, thanks to Przemyslaw Skibinski +API : ZSTD_getFrameParams() provides size of decompressed content +New : highest compression modes require `--ultra` command to fully unleash their capacity +Fixed : zstd cli return error code > 0 and removes dst file artifact when decompression fails, thanks to Chip Turner + +v0.5.1 +New : Optimal parsing => Very high compression modes, thanks to Przemyslaw Skibinski +Changed : Dictionary builder integrated into libzstd and zstd cli +Changed (!) : zstd cli now uses "multiple input files" as default mode. See `zstd -h`. +Fix : high compression modes for big-endian platforms +New : zstd cli : `-t` | `--test` command + +v0.5.0 +New : dictionary builder utility +Changed : streaming & dictionary API +Improved : better compression of small data + +v0.4.7 +Improved : small compression speed improvement in HC mode +Changed : `zstd_decompress.c` has ZSTD_LEGACY_SUPPORT to 0 by default +fix : bt search bug + +v0.4.6 +fix : fast compression mode on Windows +New : cmake configuration file, thanks to Artyom Dymchenko +Improved : high compression mode on repetitive data +New : block-level API +New : ZSTD_duplicateCCtx() + +v0.4.5 +new : -m/--multiple : compress/decompress multiple files + +v0.4.4 +Fixed : high compression modes for Windows 32 bits +new : external dictionary API extended to buffered mode and accessible through command line +new : windows DLL project, thanks to Christophe Chevalier + +v0.4.3 : +new : external dictionary API +new : zstd-frugal + +v0.4.2 : +Generic minor improvements for small blocks +Fixed : big-endian compatibility, by Peter Harris (#85) + +v0.4.1 +Fixed : ZSTD_LEGACY_SUPPORT=0 build mode (reported by Luben) +removed `zstd.c` + +v0.4.0 +Command line utility compatible with high compression levels +Removed zstdhc => merged into zstd +Added : ZBUFF API (see zstd_buffered.h) +Rolling buffer support + +v0.3.6 +small blocks params + +v0.3.5 +minor generic compression improvements + +v0.3.4 +Faster fast cLevels + +v0.3.3 +Small compression ratio improvement + +v0.3.2 +Fixed Visual Studio + +v0.3.1 : +Small compression ratio improvement + +v0.3 +HC mode : compression levels 2-26 + +v0.2.2 +Fix : Visual Studio 2013 & 2015 release compilation, by Christophe Chevalier + +v0.2.1 +Fix : Read errors, advanced fuzzer tests, by Hanno Böck + +v0.2.0 +**Breaking format change** +Faster decompression speed +Can still decode v0.1 format + +v0.1.3 +fix uninitialization warning, reported by Evan Nemerson + +v0.1.2 +frame concatenation support + +v0.1.1 +fix compression bug +detects write-flush errors + +v0.1.0 +first release Modified: head/sys/contrib/zstd/Makefile ============================================================================== --- head/sys/contrib/zstd/Makefile Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/Makefile Fri Apr 19 02:54:13 2019 (r346364) @@ -156,7 +156,7 @@ list: done \ } | column -t -s $$'\t' -.PHONY: install clangtest armtest usan asan uasan +.PHONY: install armtest usan asan uasan install: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ @@ -188,7 +188,7 @@ gcc7build: clean .PHONY: clangbuild clangbuild: clean clang -v - CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + CXX=clang++ CC=clang CFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" $(MAKE) all m32build: clean gcc -v @@ -231,10 +231,6 @@ gcc5test: clean gcc6test: clean gcc-6 -v $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror" - -clangtest: clean - clang -v - $(MAKE) all CXX=clang++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" armtest: clean $(MAKE) -C $(TESTDIR) datagen # use native, faster Modified: head/sys/contrib/zstd/README.md ============================================================================== --- head/sys/contrib/zstd/README.md Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/README.md Fri Apr 19 02:54:13 2019 (r346364) @@ -14,6 +14,7 @@ a list of known ports and bindings is provided on [Zst [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink] +[![Build status][CirrusDevBadge]][CirrusLink] [travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite" [travisLink]: https://travis-ci.org/facebook/zstd @@ -21,14 +22,16 @@ a list of known ports and bindings is provided on [Zst [AppveyorLink]: https://ci.appveyor.com/project/YannCollet/zstd-p0yf0 [CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite" [CircleLink]: https://circleci.com/gh/facebook/zstd +[CirrusDevBadge]: https://api.cirrus-ci.com/github/facebook/zstd.svg?branch=dev +[CirrusLink]: https://cirrus-ci.com/github/facebook/zstd ## Benchmarks For reference, several fast compression algorithms were tested and compared -on a server running Linux Debian (`Linux version 4.14.0-3-amd64`), -with a Core i7-6700K CPU @ 4.0GHz, +on a server running Arch Linux (`Linux version 5.0.5-arch1-1`), +with a Core i9-9900K CPU @ 5.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep -compiled with [gcc] 7.3.0, +compiled with [gcc] 8.2.1, on the [Silesia compression corpus]. [lzbench]: https://github.com/inikep/lzbench @@ -37,14 +40,14 @@ on the [Silesia compression corpus]. | Compressor name | Ratio | Compression| Decompress.| | --------------- | ------| -----------| ---------- | -| **zstd 1.3.4 -1** | 2.877 | 470 MB/s | 1380 MB/s | -| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 400 MB/s | -| brotli 1.0.2 -0 | 2.701 | 410 MB/s | 430 MB/s | -| quicklz 1.5.0 -1 | 2.238 | 550 MB/s | 710 MB/s | -| lzo1x 2.09 -1 | 2.108 | 650 MB/s | 830 MB/s | -| lz4 1.8.1 | 2.101 | 750 MB/s | 3700 MB/s | -| snappy 1.1.4 | 2.091 | 530 MB/s | 1800 MB/s | -| lzf 3.6 -1 | 2.077 | 400 MB/s | 860 MB/s | +| **zstd 1.4.0 -1** | 2.884 | 530 MB/s | 1360 MB/s | +| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 440 MB/s | +| brotli 1.0.7 -0 | 2.701 | 430 MB/s | 470 MB/s | +| quicklz 1.5.0 -1 | 2.238 | 600 MB/s | 800 MB/s | +| lzo1x 2.09 -1 | 2.106 | 680 MB/s | 950 MB/s | +| lz4 1.8.3 | 2.101 | 800 MB/s | 4220 MB/s | +| snappy 1.1.4 | 2.073 | 580 MB/s | 2020 MB/s | +| lzf 3.6 -1 | 2.077 | 440 MB/s | 930 MB/s | [zlib]: http://www.zlib.net/ [LZ4]: http://www.lz4.org/ Modified: head/sys/contrib/zstd/contrib/pzstd/Makefile ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/Makefile Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/contrib/pzstd/Makefile Fri Apr 19 02:54:13 2019 (r346364) @@ -190,13 +190,15 @@ $(ZSTDDIR)/libzstd.a: $(ZSTD_FILES) CFLAGS="$(ALL_CFLAGS)" LDFLAGS="$(ALL_LDFLAGS)" $(MAKE) -C $(ZSTDDIR) libzstd.a # Rules to build the tests -test/RoundTripTest$(EXT): test/RoundTripTest.o $(PROGDIR)/datagen.o Options.o \ +test/RoundTripTest$(EXT): test/RoundTripTest.o $(PROGDIR)/datagen.o \ + $(PROGDIR)/util.o Options.o \ Pzstd.o SkippableFrame.o $(ZSTDDIR)/libzstd.a $(LD_COMMAND) test/%Test$(EXT): PZSTD_LDFLAGS += $(GTEST_LIB) test/%Test$(EXT): LIBS += -lgtest -lgtest_main -test/%Test$(EXT): test/%Test.o $(PROGDIR)/datagen.o Options.o Pzstd.o \ +test/%Test$(EXT): test/%Test.o $(PROGDIR)/datagen.o \ + $(PROGDIR)/util.o Options.o Pzstd.o \ SkippableFrame.o $(ZSTDDIR)/libzstd.a $(LD_COMMAND) Modified: head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp Fri Apr 19 02:54:13 2019 (r346364) @@ -55,7 +55,7 @@ static std::uint64_t handleOneInput(const Options &opt SharedState& state) { auto inputSize = fileSizeOrZero(inputFile); // WorkQueue outlives ThreadPool so in the case of error we are certain - // we don't accidently try to call push() on it after it is destroyed + // we don't accidentally try to call push() on it after it is destroyed WorkQueue> outs{options.numThreads + 1}; std::uint64_t bytesRead; std::uint64_t bytesWritten; Modified: head/sys/contrib/zstd/contrib/pzstd/utils/Range.h ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/utils/Range.h Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/contrib/pzstd/utils/Range.h Fri Apr 19 02:54:13 2019 (r346364) @@ -9,7 +9,7 @@ /** * A subset of `folly/Range.h`. - * All code copied verbatiam modulo formatting + * All code copied verbatim modulo formatting */ #pragma once Modified: head/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h Fri Apr 19 02:54:13 2019 (r346364) @@ -54,7 +54,7 @@ class ResourcePool { /** * @returns A unique pointer to a resource. The resource is null iff - * there are no avaiable resources and `factory()` returns null. + * there are no available resources and `factory()` returns null. */ UniquePtr get() { std::lock_guard lock(mutex_); Modified: head/sys/contrib/zstd/doc/README.md ============================================================================== --- head/sys/contrib/zstd/doc/README.md Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/doc/README.md Fri Apr 19 02:54:13 2019 (r346364) @@ -12,8 +12,8 @@ __`zstd_compression_format.md`__ : This document defin Compliant decoders must adhere to this document, and compliant encoders must generate data that follows it. -Should you look for ressources to develop your own port of Zstandard algorithm, -you may find the following ressources useful : +Should you look for resources to develop your own port of Zstandard algorithm, +you may find the following resources useful : __`educational_decoder`__ : This directory contains an implementation of a Zstandard decoder, compliant with the Zstandard compression format. Modified: head/sys/contrib/zstd/doc/educational_decoder/Makefile ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/Makefile Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/doc/educational_decoder/Makefile Fri Apr 19 02:54:13 2019 (r346364) @@ -7,7 +7,7 @@ CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDD CFLAGS ?= -O3 CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ - -Wstrict-prototypes -Wundef -Wformat-security \ + -Wstrict-prototypes -Wundef \ -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ -Wredundant-decls CFLAGS += $(DEBUGFLAGS) Modified: head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c Fri Apr 19 02:54:13 2019 (r346364) @@ -358,7 +358,7 @@ static u32 copy_literals(const size_t seq, istream_t * ostream_t *const out); // Given an offset code from a sequence command (either an actual offset value -// or an index for previous offset), computes the correct offset and udpates +// or an index for previous offset), computes the correct offset and updates // the offset history static size_t compute_offset(sequence_command_t seq, u64 *const offset_hist); Modified: head/sys/contrib/zstd/doc/zstd_manual.html ============================================================================== --- head/sys/contrib/zstd/doc/zstd_manual.html Fri Apr 19 02:28:04 2019 (r346363) +++ head/sys/contrib/zstd/doc/zstd_manual.html Fri Apr 19 02:54:13 2019 (r346364) @@ -1,37 +1,46 @@ -zstd 1.3.8 Manual +zstd 1.4.0 Manual -

zstd 1.3.8 Manual

+

zstd 1.4.0 Manual


Contents

  1. Introduction
  2. Version
  3. Default constant
  4. -
  5. Simple API
  6. -
  7. Explicit context
  8. -
  9. Simple dictionary API
  10. -
  11. Bulk processing dictionary API
  12. -
  13. Streaming
  14. -
  15. Streaming compression - HowTo
  16. -
  17. Streaming decompression - HowTo
  18. -
  19. ADVANCED AND EXPERIMENTAL FUNCTIONS
  20. -
  21. Candidate API for promotion to stable status
  22. -
  23. Advanced compression API
  24. -
  25. experimental API (static linking only)
  26. -
  27. Frame size functions
  28. -
  29. Memory management
  30. -
  31. Advanced compression functions
  32. -
  33. Advanced decompression functions
  34. -
  35. Advanced streaming functions
  36. -
  37. Buffer-less and synchronous inner streaming functions
  38. -
  39. Buffer-less streaming compression (synchronous mode)
  40. -
  41. Buffer-less streaming decompression (synchronous mode)
  42. -
  43. ZSTD_getFrameHeader() :
  44. -
  45. Block level API
  46. +
  47. Constants
  48. +
  49. Simple API
  50. +
  51. Explicit context
  52. +
  53. Advanced compression API
  54. +
  55. Advanced decompression API
  56. +
  57. Streaming
  58. +
  59. Streaming compression - HowTo
  60. +
  61. This is a legacy streaming API, and can be replaced by ZSTD_CCtx_reset() and
  62. +
  63. Equivalent to:
  64. +
  65. Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).
  66. +
  67. Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).
  68. +
  69. Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).
  70. +
  71. Streaming decompression - HowTo
  72. +
  73. Simple dictionary API
  74. +
  75. Bulk processing dictionary API
  76. +
  77. Dictionary helper functions
  78. +
  79. Advanced dictionary and prefix API
  80. +
  81. ADVANCED AND EXPERIMENTAL FUNCTIONS
  82. +
  83. experimental API (static linking only)
  84. +
  85. Frame size functions
  86. +
  87. ZSTD_decompressBound() :
  88. +
  89. Memory management
  90. +
  91. Advanced compression functions
  92. +
  93. Advanced decompression functions
  94. +
  95. Advanced streaming functions
  96. +
  97. Buffer-less and synchronous inner streaming functions
  98. +
  99. Buffer-less streaming compression (synchronous mode)
  100. +
  101. Buffer-less streaming decompression (synchronous mode)
  102. +
  103. ZSTD_getFrameHeader() :
  104. +
  105. Block level API

Introduction

@@ -71,8 +80,10 @@
 

Default constant


 
-

Simple API


+

Constants


 
+

Simple API


+
 
size_t ZSTD_compress( void* dst, size_t dstCapacity,
                 const void* src, size_t srcSize,
                       int compressionLevel);
@@ -126,13 +137,22 @@ unsigned long long ZSTD_getFrameContentSize(const void
  @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise. 
 


+
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 +


+

Helper functions

#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */
 size_t      ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case single-pass scenario */
 unsigned    ZSTD_isError(size_t code);          /*!< tells if a `size_t` function result is an error code */
 const char* ZSTD_getErrorName(size_t code);     /*!< provides readable string from an error code */
+int         ZSTD_minCLevel(void);               /*!< minimum negative compression level allowed */
 int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
 

-

Explicit context


+

Explicit context


 
 

Compression context

  When compressing many times,
   it is recommended to allocate a context just once, and re-use it for each successive compression operation.
@@ -169,229 +189,8 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
  
 


-

Simple dictionary API


+

Advanced compression API


 
-
size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
-                               void* dst, size_t dstCapacity,
-                         const void* src, size_t srcSize,
-                         const void* dict,size_t dictSize,
-                               int compressionLevel);
-

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. - 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 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. -


- -

Bulk processing dictionary API


-
-
ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
-                             int compressionLevel);
-

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, 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);
-

Function frees memory allocated by ZSTD_createCDict(). -


- -
size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,
-                                void* dst, size_t dstCapacity,
-                          const void* src, size_t srcSize,
-                          const ZSTD_CDict* cdict);
-

Compression using a digested Dictionary. - 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. -


- -
size_t      ZSTD_freeDDict(ZSTD_DDict* ddict);
-

Function frees memory allocated with ZSTD_createDDict() -


- -
size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,
-                                  void* dst, size_t dstCapacity,
-                            const void* src, size_t srcSize,
-                            const ZSTD_DDict* ddict);
-

Decompression using a digested Dictionary. - Recommended when same dictionary is used multiple times. -


- -

Streaming


-
-
typedef struct ZSTD_inBuffer_s {
-  const void* src;    /**< start of input buffer */
-  size_t size;        /**< size of input buffer */
-  size_t pos;         /**< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size */
-} ZSTD_inBuffer;
-

-
typedef struct ZSTD_outBuffer_s {
-  void*  dst;         /**< start of output buffer */
-  size_t size;        /**< size of output buffer */
-  size_t pos;         /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */
-} ZSTD_outBuffer;
-

-

Streaming compression - HowTo

-  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 since it will play nicer with system's memory, by re-using already allocated memory.
-
-  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,
-  for example, because the output buffer is already full,
-  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,
-  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 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.
-  Note that, if `output->size` is too small, a single invocation of ZSTD_flushStream() might not be enough (return code > 0).
-  In which case, make some room to receive more compressed data, and call again ZSTD_flushStream().
-  @return : 0 if internal buffers are entirely flushed,
-            >0 if some data still present within internal buffer (the value is minimal estimation of remaining size),
-            or an error code, which can be tested using ZSTD_isError().
-
-  ZSTD_endStream() instructs to finish a frame.
-  It will perform a flush and write frame epilogue.
-  The epilogue is required for decoders to consider a frame completed.
-  flush() operation is the same, and follows same rules as ZSTD_flushStream().
-  @return : 0 if frame fully completed and fully flushed,
-            >0 if some data still present within internal buffer (the value is minimal estimation of remaining size),
-            or an error code, which can be tested using ZSTD_isError().
-
- 
-
- -
typedef ZSTD_CCtx ZSTD_CStream;  /**< CCtx and CStream are now effectively same object (>= v1.3.0) */
-

-

ZSTD_CStream management functions

ZSTD_CStream* ZSTD_createCStream(void);
-size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
-

-

Streaming compression functions

size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
-size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
-size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
-size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
-

-
size_t ZSTD_CStreamInSize(void);    /**< recommended size for input buffer */
-

-
size_t ZSTD_CStreamOutSize(void);   /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block in all circumstances. */
-

-

Streaming decompression - HowTo

-  A ZSTD_DStream object is required to track streaming operations.
-  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.
- @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, respecting output buffer size.
-  If `output.pos < output.size`, decoder has flushed everything it could.
-  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.
-  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 (just a hint for better latency)
-                                that will never request more than the remaining frame size.
- 
-
- -
typedef ZSTD_DCtx ZSTD_DStream;  /**< DCtx and DStream are now effectively same object (>= v1.3.0) */
-

-

ZSTD_DStream management functions

ZSTD_DStream* ZSTD_createDStream(void);
-size_t ZSTD_freeDStream(ZSTD_DStream* zds);
-

-

Streaming decompression functions

size_t ZSTD_initDStream(ZSTD_DStream* zds);
-size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
-

-
size_t ZSTD_DStreamInSize(void);    /*!< recommended size for input buffer */
-

-
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 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 */
-

-
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,
@@ -407,7 +206,10 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
 

typedef enum {
 
-    /* compression parameters */
+    /* compression parameters
+     * Note: When compressing with a ZSTD_CDict these parameters are superseded
+     * by the parameters used to construct the ZSTD_CDict. See ZSTD_CCtx_refCDict()
+     * for more info (superseded-by-cdict). */
     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.
@@ -529,6 +331,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
      * ZSTD_c_format
      * ZSTD_c_forceMaxWindow
      * ZSTD_c_forceAttachDict
+     * ZSTD_c_literalCompressionMode
      * 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.
@@ -536,7 +339,8 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
      ZSTD_c_experimentalParam1=500,
      ZSTD_c_experimentalParam2=10,
      ZSTD_c_experimentalParam3=1000,
-     ZSTD_c_experimentalParam4=1001

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

From owner-svn-src-head@freebsd.org  Fri Apr 19 03:36:24 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EBE81583D94;
 Fri, 19 Apr 2019 03:36:24 +0000 (UTC)
 (envelope-from rmacklem@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 C10B88B928;
 Fri, 19 Apr 2019 03:36:23 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F6C228AB0;
 Fri, 19 Apr 2019 03:36:23 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3J3aNLt087781;
 Fri, 19 Apr 2019 03:36:23 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3J3aMUg087776;
 Fri, 19 Apr 2019 03:36:22 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904190336.x3J3aMUg087776@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
 rmacklem@FreeBSD.org using -f
From: Rick Macklem 
Date: Fri, 19 Apr 2019 03:36:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346365 - in head/sys/fs: nfs nfsserver
X-SVN-Group: head
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver
X-SVN-Commit-Revision: 346365
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: C10B88B928
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.97)[-0.970,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, 19 Apr 2019 03:36:24 -0000

Author: rmacklem
Date: Fri Apr 19 03:36:22 2019
New Revision: 346365
URL: https://svnweb.freebsd.org/changeset/base/346365

Log:
  Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes.
  
  During inspection of a packet trace, I noticed that an NFSv4.0 mount
  reported that it supported attributes that are only defined for NFSv4.1.
  In practice, this bug appears to be benign, since NFSv4.0 clients will
  not use attributes that were added for NFSv4.1.
  However, this was not correct and this patch fixes the NFSv4.0 server
  so that it only supports attributes defined for NFSv4.0.
  It also adds a definition for NFSv4.1 attributes that can only be set,
  although it is only defined as 0 for now.
  This is anticipation of the addition of support for the NFSv4.1 mode+mask
  attribute soon.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfsproto.h
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfs/nfs.h
==============================================================================
--- head/sys/fs/nfs/nfs.h	Fri Apr 19 02:54:13 2019	(r346364)
+++ head/sys/fs/nfs/nfs.h	Fri Apr 19 03:36:22 2019	(r346365)
@@ -423,10 +423,14 @@ typedef struct {
 	(t)->bits[2] = (f)->bits[2];					\
 } while (0)
 
-#define	NFSSETSUPP_ATTRBIT(b) do { 					\
+#define	NFSSETSUPP_ATTRBIT(b, n) do { 					\
 	(b)->bits[0] = NFSATTRBIT_SUPP0; 				\
-	(b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY);	\
-	(b)->bits[2] = NFSATTRBIT_SUPP2;				\
+	(b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY1);	\
+	(b)->bits[2] = (NFSATTRBIT_SUPP2 | NFSATTRBIT_SUPPSETONLY2);	\
+	if (((n)->nd_flag & ND_NFSV41) == 0) {				\
+		(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1;			\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
+	}								\
 } while (0)
 
 #define	NFSISSET_ATTRBIT(b, p)	((b)->bits[(p) / 32] & (1 << ((p) % 32)))
@@ -445,16 +449,22 @@ typedef struct {
 	(b)->bits[2] &= ((a)->bits[2]);		 			\
 } while (0)
 
-#define	NFSCLRNOTFILLABLE_ATTRBIT(b) do { 				\
+#define	NFSCLRNOTFILLABLE_ATTRBIT(b, n) do { 				\
 	(b)->bits[0] &= NFSATTRBIT_SUPP0;	 			\
 	(b)->bits[1] &= NFSATTRBIT_SUPP1;				\
 	(b)->bits[2] &= NFSATTRBIT_SUPP2;				\
+	if (((n)->nd_flag & ND_NFSV41) == 0) {				\
+		(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1;			\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
+	}								\
 } while (0)
 
-#define	NFSCLRNOTSETABLE_ATTRBIT(b) do { 				\
+#define	NFSCLRNOTSETABLE_ATTRBIT(b, n) do { 				\
 	(b)->bits[0] &= NFSATTRBIT_SETABLE0;	 			\
 	(b)->bits[1] &= NFSATTRBIT_SETABLE1;				\
 	(b)->bits[2] &= NFSATTRBIT_SETABLE2;				\
+	if (((n)->nd_flag & ND_NFSV41) == 0)				\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
 } while (0)
 
 #define	NFSNONZERO_ATTRBIT(b)	((b)->bits[0] || (b)->bits[1] || (b)->bits[2])

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c	Fri Apr 19 02:54:13 2019	(r346364)
+++ head/sys/fs/nfs/nfs_commonsubs.c	Fri Apr 19 03:36:22 2019	(r346365)
@@ -1293,7 +1293,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
 			if (error)
 			    goto nfsmout;
 			if (compare && !(*retcmpp)) {
-			   NFSSETSUPP_ATTRBIT(&checkattrbits);
+			   NFSSETSUPP_ATTRBIT(&checkattrbits, nd);
 
 			   /* Some filesystem do not support NFSv4ACL   */
 			   if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) {
@@ -2129,8 +2129,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
 			if (error)
 			    goto nfsmout;
 			if (compare && !(*retcmpp)) {
-			   NFSSETSUPP_ATTRBIT(&checkattrbits);
-			   NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits);
+			   NFSSETSUPP_ATTRBIT(&checkattrbits, nd);
+			   NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits, nd);
 			   NFSCLRBIT_ATTRBIT(&checkattrbits,
 				NFSATTRBIT_TIMEACCESSSET);
 			   if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits)
@@ -2460,10 +2460,10 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount
 	 * reply call.
 	 */
 	if (p == NULL && cred == NULL) {
-		NFSCLRNOTSETABLE_ATTRBIT(retbitp);
+		NFSCLRNOTSETABLE_ATTRBIT(retbitp, nd);
 		aclp = saclp;
 	} else {
-		NFSCLRNOTFILLABLE_ATTRBIT(retbitp);
+		NFSCLRNOTFILLABLE_ATTRBIT(retbitp, nd);
 		naclp = acl_alloc(M_WAITOK);
 		aclp = naclp;
 	}
@@ -2533,7 +2533,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount
 	    if (NFSISSET_ATTRBIT(retbitp, bitpos)) {
 		switch (bitpos) {
 		case NFSATTRBIT_SUPPORTEDATTRS:
-			NFSSETSUPP_ATTRBIT(&attrbits);
+			NFSSETSUPP_ATTRBIT(&attrbits, nd);
 			if (nfsrv_useacl == 0 || ((cred != NULL || p != NULL)
 			    && supports_nfsv4acls == 0)) {
 			    NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACLSUPPORT);
@@ -2935,8 +2935,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount
 			retnum += NFSX_HYPER;
 			break;
 		case NFSATTRBIT_SUPPATTREXCLCREAT:
-			NFSSETSUPP_ATTRBIT(&attrbits);
-			NFSCLRNOTSETABLE_ATTRBIT(&attrbits);
+			NFSSETSUPP_ATTRBIT(&attrbits, nd);
+			NFSCLRNOTSETABLE_ATTRBIT(&attrbits, nd);
 			NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET);
 			retnum += nfsrv_putattrbit(nd, &attrbits);
 			break;

Modified: head/sys/fs/nfs/nfsproto.h
==============================================================================
--- head/sys/fs/nfs/nfsproto.h	Fri Apr 19 02:54:13 2019	(r346364)
+++ head/sys/fs/nfs/nfsproto.h	Fri Apr 19 03:36:22 2019	(r346365)
@@ -1086,11 +1086,11 @@ struct nfsv3_sattr {
 	NFSATTRBM_SUPPATTREXCLCREAT)
 
 /*
- * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and
- * NFSATTRBIT_TIMEMODIFYSET.
+ * These are the set only attributes.
  */
-#define	NFSATTRBIT_SUPPSETONLY	 (NFSATTRBM_TIMEACCESSSET |		\
+#define	NFSATTRBIT_SUPPSETONLY1	 (NFSATTRBM_TIMEACCESSSET |		\
 				 NFSATTRBM_TIMEMODIFYSET)
+#define	NFSATTRBIT_SUPPSETONLY2	0
 
 /*
  * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31
@@ -1107,6 +1107,18 @@ struct nfsv3_sattr {
  	NFSATTRBM_TIMEACCESSSET |					\
  	NFSATTRBM_TIMEMODIFYSET)
 #define	NFSATTRBIT_SETABLE2		0
+
+/*
+ * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1.
+ */
+#define	NFSATTRBIT_NFSV41_1						\
+	(NFSATTRBM_FSLAYOUTTYPE)
+#define	NFSATTRBIT_NFSV41_2						\
+	(NFSATTRBM_LAYOUTTYPE |						\
+	NFSATTRBM_LAYOUTBLKSIZE |					\
+	NFSATTRBM_LAYOUTALIGNMENT |					\
+	NFSATTRBM_MODESETMASKED |					\
+	NFSATTRBM_SUPPATTREXCLCREAT)
 
 /*
  * Set of attributes that the getattr vnode op needs.

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Apr 19 02:54:13 2019	(r346364)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Apr 19 03:36:22 2019	(r346365)
@@ -2126,7 +2126,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg
 		if (error)
 			goto nfsmout;
 		NFSSET_ATTRBIT(&savbits, &attrbits);
-		NFSCLRNOTFILLABLE_ATTRBIT(&attrbits);
+		NFSCLRNOTFILLABLE_ATTRBIT(&attrbits, nd);
 		NFSZERO_ATTRBIT(&rderrbits);
 		NFSSETBIT_ATTRBIT(&rderrbits, NFSATTRBIT_RDATTRERROR);
 	} else {

From owner-svn-src-head@freebsd.org  Fri Apr 19 05:56:36 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3BA0158657B;
 Fri, 19 Apr 2019 05:56:35 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com
 [IPv6:2607:f8b0:4864:20::634])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4F3CF8F211;
 Fri, 19 Apr 2019 05:56:35 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pl1-x634.google.com with SMTP id cv12so2180921plb.9;
 Thu, 18 Apr 2019 22:56:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=xeISQ4x22iCyKhNqD8fprOySwp87jkD5iT1s2RUJSjU=;
 b=ExAq50xcs29SLlWrmvv0c1ZmZ8d57QVidLM3wU8NXPiJJkBQ6l8ej7RFyP5VJ0SIAh
 zbQt98EVYiTsrmYqPRIi6cx1q2FXocnKE7Vb6BA9AxmyMSlkn70v2rOQ1hUiBU/NgD0j
 ZIbikSk4lb5i5uwB9f4VgOsvzoRBzHlmO8I7fkPR6dFd01mq7mvsZuW3YR1Tms/8F0EI
 Wj7sN7ToVwm2H+PWxKcNIyTOrCSMJzRfhQQ59sK97qqOVq5Yao7CHMNvG9JeHyht0dSp
 a9Dbv3hIYfdKUCalwJH7iqYULTkKnozEAfzEa2krbU1nRnwptUDMnMZv2R8/nt/9n6cr
 9m3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=xeISQ4x22iCyKhNqD8fprOySwp87jkD5iT1s2RUJSjU=;
 b=W8v6hFpmuFDgFrKtpoqRNS95YXnSVESe6U89WjPMe6dTgYteCK3516/7rhCByfbSxR
 QZNYkzL1Ya5CLtftJaNWt9M1I2WwgBv2j0XZ3TYL3832EFXQ/hZcFYZUT0VokjYbPf9y
 nZ457qut50vRf2ex6PYMSDYTHdV/IHg5bsOdnPFf+Bg9CQUiiUK2PpvHjdnrNzkcd/pq
 gn4zB/OjSfX6rrESE94sSI+Y4O//hX2TS3rSWx6nkha6Rjxw+I3h+PA0if6gaumzOa7T
 uvHhFh1gIi3avewjOAYEMWJLv0msKvA0IeXDJF81LH7sAP3jBaEA3pxSCPUuFcxUpdZe
 dbiQ==
X-Gm-Message-State: APjAAAV+IhKFSt9kr7YTt64IzuddjQhi3qSHZ8c/PETzgn/v1EczXcah
 UmhJPFlJqK/mo1/8J1RFiRtBkh4yv0o=
X-Google-Smtp-Source: APXvYqzRN36+4qDY6Udgyito3+DZ7c6RMnC24PVZaXnnj09QQmfsN36qlKDf+uKWa/LCuIH0lo/EmQ==
X-Received: by 2002:a17:902:e302:: with SMTP id
 cg2mr1883852plb.285.1555653393676; 
 Thu, 18 Apr 2019 22:56:33 -0700 (PDT)
Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id k186sm7515009pfc.137.2019.04.18.22.56.32
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 18 Apr 2019 22:56:32 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (1.0)
Subject: Re: svn commit: r346358 - in head: . sys/dev/random sys/libkern
 sys/mips/conf sys/sys
From: Enji Cooper 
X-Mailer: iPhone Mail (16E227)
In-Reply-To: <201904182048.x3IKmtG2073301@repo.freebsd.org>
Date: Thu, 18 Apr 2019 22:56:32 -0700
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201904182048.x3IKmtG2073301@repo.freebsd.org>
To: Conrad Meyer 
X-Rspamd-Queue-Id: 4F3CF8F211
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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[];
 NEURAL_HAM_SHORT(-0.95)[-0.953,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, 19 Apr 2019 05:56:36 -0000


> On Apr 18, 2019, at 13:48, Conrad Meyer  wrote:
>=20
> Author: cem
> Date: Thu Apr 18 20:48:54 2019
> New Revision: 346358
> URL: https://svnweb.freebsd.org/changeset/base/346358
>=20
> Log:
>  random(4): Restore availability tradeoff prior to r346250
>=20
>  As discussed in that commit message, it is a dangerous default.  But the
>  safe default causes enough pain on a variety of platforms that for now,
>  restore the prior default.
>=20
>  Some of this is self-induced pain we should/could do better about; for
>  example, programmatic CI systems and VM managers should introduce entropy=

>  from the host for individual VM instances.  This is considered a future w=
ork
>  item.
>=20
>  On modern x86 and Power9 systems, this may be wholly unnecessary after
>  D19928 lands (even in the non-ideal case where early /boot/entropy is
>  unavailable), because they have fast hardware random sources available ea=
rly
>  in boot.  But D19928 is not yet landed and we have a host of architecture=
s
>  which do not provide fast random sources.
>=20
>  This change adds several tunables and diagnostic sysctls, documented
>  thoroughly in UPDATING and sys/dev/random/random_infra.c.

Thank you for doing this Conrad!

One request: can these sysctls/tunables please be documented in random(4)? N=
ot everyone has access to UPDATING with binary distributions.

Thank you so very much!
-Enji=

From owner-svn-src-head@freebsd.org  Fri Apr 19 06:49:47 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9872D1587344;
 Fri, 19 Apr 2019 06:49:47 +0000 (UTC) (envelope-from phk@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 365C56847C;
 Fri, 19 Apr 2019 06:49:47 +0000 (UTC) (envelope-from phk@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A0E12AA75;
 Fri, 19 Apr 2019 06:49:47 +0000 (UTC) (envelope-from phk@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3J6nk26086970;
 Fri, 19 Apr 2019 06:49:46 GMT (envelope-from phk@FreeBSD.org)
Received: (from phk@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3J6nkdC086969;
 Fri, 19 Apr 2019 06:49:46 GMT (envelope-from phk@FreeBSD.org)
Message-Id: <201904190649.x3J6nkdC086969@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org
 using -f
From: Poul-Henning Kamp 
Date: Fri, 19 Apr 2019 06:49:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346369 - head/sbin/md5
X-SVN-Group: head
X-SVN-Commit-Author: phk
X-SVN-Commit-Paths: head/sbin/md5
X-SVN-Commit-Revision: 346369
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 365C56847C
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.95)[-0.950,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, 19 Apr 2019 06:49:47 -0000

Author: phk
Date: Fri Apr 19 06:49:46 2019
New Revision: 346369
URL: https://svnweb.freebsd.org/changeset/base/346369

Log:
  Close filedescriptors when done with them.

Modified:
  head/sbin/md5/md5.c

Modified: head/sbin/md5/md5.c
==============================================================================
--- head/sbin/md5/md5.c	Fri Apr 19 03:47:59 2019	(r346368)
+++ head/sbin/md5/md5.c	Fri Apr 19 06:49:46 2019	(r346369)
@@ -247,7 +247,9 @@ main(int argc, char *argv[])
 					err(1, "capsicum");
 #endif
 			}
-			if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) {
+			p = Algorithm[digest].Fd(fd, buf);
+			(void)close(fd);
+			if (p == NULL) {
 				warn("%s", *argv);
 				failed++;
 			} else {

From owner-svn-src-head@freebsd.org  Fri Apr 19 10:52:56 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E18C0158C811;
 Fri, 19 Apr 2019 10:52:55 +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 873F770E54;
 Fri, 19 Apr 2019 10:52:55 +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 544032D4CB;
 Fri, 19 Apr 2019 10:52:55 +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 x3JAqt3C020034;
 Fri, 19 Apr 2019 10:52:55 GMT (envelope-from kp@FreeBSD.org)
Received: (from kp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JAqte4020033;
 Fri, 19 Apr 2019 10:52:55 GMT (envelope-from kp@FreeBSD.org)
Message-Id: <201904191052.x3JAqte4020033@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org
 using -f
From: Kristof Provost 
Date: Fri, 19 Apr 2019 10:52:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346370 - head/sbin/pfctl
X-SVN-Group: head
X-SVN-Commit-Author: kp
X-SVN-Commit-Paths: head/sbin/pfctl
X-SVN-Commit-Revision: 346370
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 873F770E54
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.975,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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, 19 Apr 2019 10:52:56 -0000

Author: kp
Date: Fri Apr 19 10:52:54 2019
New Revision: 346370
URL: https://svnweb.freebsd.org/changeset/base/346370

Log:
  pfctl: Fix ifgroup check
  
  We cannot just assume that any name which ends with a letter is a group
  That's not been true since we allowed renaming of network interfaces. It's also
  not true for things like epair0a.
  
  Try to retrieve the group members for the name to check, since we'll get ENOENT
  if the group doesn't exist.
  
  MFC after:	1 week
  Event:		Aberdeen hackathon 2019

Modified:
  head/sbin/pfctl/pfctl_optimize.c

Modified: head/sbin/pfctl/pfctl_optimize.c
==============================================================================
--- head/sbin/pfctl/pfctl_optimize.c	Fri Apr 19 06:49:46 2019	(r346369)
+++ head/sbin/pfctl/pfctl_optimize.c	Fri Apr 19 10:52:54 2019	(r346370)
@@ -1500,14 +1500,24 @@ superblock_inclusive(struct superblock *block, struct 
 int
 interface_group(const char *ifname)
 {
+	int			s;
+	struct ifgroupreq	ifgr;
+
 	if (ifname == NULL || !ifname[0])
 		return (0);
 
-	/* Real interfaces must end in a number, interface groups do not */
-	if (isdigit(ifname[strlen(ifname) - 1]))
-		return (0);
-	else
-		return (1);
+	s = get_query_socket();
+
+	memset(&ifgr, 0, sizeof(ifgr));
+	strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ);
+	if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) {
+		if (errno == ENOENT)
+			return (0);
+		else
+			err(1, "SIOCGIFGMEMB");
+	}
+
+	return (1);
 }
 
 

From owner-svn-src-head@freebsd.org  Fri Apr 19 12:07:07 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C8F2158EA2A;
 Fri, 19 Apr 2019 12:07:07 +0000 (UTC)
 (envelope-from oshogbo.vx@gmail.com)
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [IPv6:2a00:1450:4864:20::12c])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 35E41731C5;
 Fri, 19 Apr 2019 12:07:06 +0000 (UTC)
 (envelope-from oshogbo.vx@gmail.com)
Received: by mail-lf1-x12c.google.com with SMTP id i68so3918365lfi.10;
 Fri, 19 Apr 2019 05:07:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=jjqHxxVBIYetT13OgJJ0bw1na2r4Sk4JvFTnIF3BDLE=;
 b=eZd6ewxwvnGEaoNmTbv9rNK33dke5joIlLcW8P0OJi7hrmT9hsPKztkgMxoiM4B27X
 wrYvpfljJy8PGpfr7CsKcURTR7KdA2aYFqzCRo1tYup+rcMdiepIPb6ijYn2NdITzBdq
 E1RsW8vcMfLo7kHkfoMw97WJJjgx56wChrv8MjlQjio/zJwdTzB1qfBdwejFK/7OhMTp
 4UDZFhytKre+LrxhRa8uIZkizWMItTRtTWSi4XSeXl3NeoDqoxnbEjR3C4GLzfYNbI8b
 GTRRG7of6hhDatkGjfZxOUj9QIRP9yGQBxPMfjUOw5rrgTnuqFT+icxVLx37T6DFp0n9
 kTrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
 :references:mime-version:content-disposition:in-reply-to:user-agent;
 bh=jjqHxxVBIYetT13OgJJ0bw1na2r4Sk4JvFTnIF3BDLE=;
 b=bM7kID1CbhHm+ndxTuQA+07HXvmAxxXvpA0zQD/FgeXZRrYWYVnmenh7s4sT4VUnhS
 LXWGFOE/jSB9PyIKfVBcEI6L7gjEID3AWDp5D4Sne2aGsZS1DRylnkUW/aN8JsCwcoA6
 q5oi3EkBiq5mCrwoRbAHCoKpKVa35WIpbnLExk9y1n7bjFaX8qNs7dm5EV9ZyqtkNiBK
 9TcuXoUCdCQ9tDr+hDP6eaUWL5Qx3VjbtgnHmA2LasM4Wkl2RnJucbcgSnmO8xswOL0F
 up2xdhTcjF+XGd2jaL+L4D/Iy4FNHIvBGAKVBrGOoe8buajWiQhBL0IjHJYsWqLcBzXU
 V1lQ==
X-Gm-Message-State: APjAAAU9BMtj29XOmraILMqRKtIGPq9ejBP6XqpBjvESB3vb0Kdk/B1U
 WZBVgxdgtd6YbnfScgTCYhzqeYZYvlc=
X-Google-Smtp-Source: APXvYqx/cqYCL902SrTBQ6pyxX70aeAgf84kUmhYtDFDeZc4Ji+tjsdy6G7laJPS/cG+Pu/aV+x+kw==
X-Received: by 2002:a19:8017:: with SMTP id b23mr2223359lfd.12.1555675622770; 
 Fri, 19 Apr 2019 05:07:02 -0700 (PDT)
Received: from jarvis ([77.79.224.226])
 by smtp.gmail.com with ESMTPSA id d80sm414629lfd.90.2019.04.19.05.07.00
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 19 Apr 2019 05:07:01 -0700 (PDT)
Sender: Mariusz Zaborski 
Date: Fri, 19 Apr 2019 14:06:25 +0200
From: Mariusz Zaborski 
To: Adrian Chadd 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r346322 - head/lib/libcasper/services/cap_fileargs
Message-ID: <20190419120625.GA2747@jarvis>
References: <201904171658.x3HGwckd080598@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z"
Content-Disposition: inline
In-Reply-To: <201904171658.x3HGwckd080598@repo.freebsd.org>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Rspamd-Queue-Id: 35E41731C5
X-Spamd-Bar: -------
Authentication-Results: mx1.freebsd.org;
 dkim=pass header.d=gmail.com header.s=20161025 header.b=eZd6ewxw;
 spf=pass (mx1.freebsd.org: domain of oshogbovx@gmail.com designates
 2a00:1450:4864:20::12c as permitted sender) smtp.mailfrom=oshogbovx@gmail.com
X-Spamd-Result: default: False [-7.64 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[];
 TO_DN_SOME(0.00)[];
 R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36];
 RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+];
 MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com];
 NEURAL_HAM_SHORT(-0.99)[-0.988,0]; SIGNED_PGP(-2.00)[];
 FORGED_SENDER(0.30)[oshogbo@freebsd.org,oshogbovx@gmail.com];
 MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com];
 ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US];
 TAGGED_FROM(0.00)[];
 FROM_NEQ_ENVFROM(0.00)[oshogbo@freebsd.org,oshogbovx@gmail.com];
 ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[];
 RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,0];
 MIME_GOOD(-0.20)[multipart/signed,text/plain];
 RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org];
 IP_SCORE(-2.84)[ip: (-9.53), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-2.24),
 country: US(-0.06)]; 
 RCVD_IN_DNSWL_NONE(0.00)[c.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org
 : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[]
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, 19 Apr 2019 12:07:07 -0000


--7AUc2qLy4jB3hD7Z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 17, 2019 at 04:58:38PM +0000, Adrian Chadd wrote:
> Author: adrian
> Date: Wed Apr 17 16:58:38 2019
> New Revision: 346322
> URL: https://svnweb.freebsd.org/changeset/base/346322
>=20
> Log:
>   [casper] fix compilation when casper is disabled.
>  =20
>   This triggers an error in gcc-mips 6.4.0 complaining about unused argum=
ents.
>  =20
>   Tested:
>  =20
>   * compiled/run on mips32; nothing complained.
>=20
> Modified:
>   head/lib/libcasper/services/cap_fileargs/cap_fileargs.h
>=20
> Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h	Wed Apr 17 16=
:45:42 2019	(r346321)
> +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h	Wed Apr 17 16=
:58:38 2019	(r346322)
> @@ -108,8 +108,12 @@ fileargs_cinitnv(cap_channel_t *cas __unused, nvlist=
_t
>  	lstat(name, sb)
>  #define	fileargs_open(fa, name)							\
>  	open(name, fa->fa_flags, fa->fa_mode)
> -#define	fileargs_fopen(fa, name, mode)						\
> -	fopen(name, mode)
> +static inline
> +FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode)
> +{
> +	(void) fa;
__unused is not good enough?
> +	return (fopen(name, mode));
> +}
>  #define	fileargs_free(fa)	(free(fa))
>  #endif
> =20
>=20

--=20
Mariusz Zaborski
oshogbo//vx		| http://oshogbo.vexillium.org
FreeBSD committer	| https://freebsd.org
Software developer	| http://wheelsystems.com
If it's not broken, let's fix it till it is!!1

--7AUc2qLy4jB3hD7Z
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEkD1x0xkJXVVY1Gwf38KEGuLGxWQFAly5ub4ACgkQ38KEGuLG
xWSAyxAAoDpfjabhuC7jWIoSj9d7qswZRdwG29tXSMQmpR5XXeNnIqH/5Avgji5m
6AFtksNmD6nquVw/hFQmPZ5Lx0//8LSc4iBOuSadunIiTrR2MwSsr7SQ3PTD077q
o+j4OHNnMqJpiwht6FvoC5iXx9sqsI52eoAo5MAq/1FhiAPkzm4VxHyxehZHM6Rq
X8SbxG0KClFOh0umt/WF0RZN8aMAnMdqK+wQEkgbgqa6PNQ7sI4NAnDem0+pwNL/
SsD/2h4JXP+g6IuHEJUYXRkZ3vobc5ovd/su+IzqBywSjQ3wraGwiEq75NKIMrDh
doi9NRdyKHKdKXI/m2CJ2AtVpMCpnSJ+b0McpsIJ8l04ElNMxXj8Uw5vlUK9cTR1
0B0E5Z4/15GPSwcD1/CzpIXP1oH3GkXj9wyJuYv8D94r5Xpw04M6ECKydEvUHfVS
j7Z0mA7IxaLC5+wYVm8SSfcSyj48x6JLRMGfDrnFfyEzrE0Qy+hUvV9eJEedc5xn
kD651vNchdisLu9INXlhqke5RIlVvea+083JERVsUDkLDcCFoURqk93wyGIMBUNs
mIm/4SaDSgh5p0BNqUw/BM+R4AxLqCyfUFlAaJbJa5jPjhQduGKD2LdZEtBGtrRA
RtTUu0iWDCF3tkyWIjmo+S2H+34kP5fRQv2E5rna449v0louZdY=
=dVXk
-----END PGP SIGNATURE-----

--7AUc2qLy4jB3hD7Z--

From owner-svn-src-head@freebsd.org  Fri Apr 19 13:43:36 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07171156CB31;
 Fri, 19 Apr 2019 13:43:36 +0000 (UTC)
 (envelope-from tychon@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.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 9DECB77B1F;
 Fri, 19 Apr 2019 13:43:35 +0000 (UTC)
 (envelope-from tychon@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 750702F16F;
 Fri, 19 Apr 2019 13:43:35 +0000 (UTC)
 (envelope-from tychon@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JDhZ9C010459;
 Fri, 19 Apr 2019 13:43:35 GMT (envelope-from tychon@FreeBSD.org)
Received: (from tychon@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JDhYVF010453;
 Fri, 19 Apr 2019 13:43:34 GMT (envelope-from tychon@FreeBSD.org)
Message-Id: <201904191343.x3JDhYVF010453@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: tychon set sender to
 tychon@FreeBSD.org using -f
From: Tycho Nightingale 
Date: Fri, 19 Apr 2019 13:43:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346386 - in head/sys: dev/bge dev/pci dev/twa x86/iommu
X-SVN-Group: head
X-SVN-Commit-Author: tychon
X-SVN-Commit-Paths: in head/sys: dev/bge dev/pci dev/twa x86/iommu
X-SVN-Commit-Revision: 346386
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 9DECB77B1F
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.99)[-0.987,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, 19 Apr 2019 13:43:36 -0000

Author: tychon
Date: Fri Apr 19 13:43:33 2019
New Revision: 346386
URL: https://svnweb.freebsd.org/changeset/base/346386

Log:
  remove the 4GB boundary requirement on PCI DMA segments
  
  Reviewed by:	kib
  Discussed with:	jhb
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D19867

Modified:
  head/sys/dev/bge/if_bgereg.h
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pcivar.h
  head/sys/dev/twa/tw_osl.h
  head/sys/dev/twa/tw_osl_freebsd.c
  head/sys/x86/iommu/intel_ctx.c

Modified: head/sys/dev/bge/if_bgereg.h
==============================================================================
--- head/sys/dev/bge/if_bgereg.h	Fri Apr 19 13:23:41 2019	(r346385)
+++ head/sys/dev/bge/if_bgereg.h	Fri Apr 19 13:43:33 2019	(r346386)
@@ -3067,3 +3067,11 @@ struct bge_softc {
 #define	BGE_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->bge_mtx, MA_OWNED)
 #define	BGE_UNLOCK(_sc)		mtx_unlock(&(_sc)->bge_mtx)
 #define	BGE_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->bge_mtx)
+
+#ifdef BUS_SPACE_MAXADDR
+#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF)
+#define	BGE_DMA_BOUNDARY	(0x100000000)
+#else
+#define	BGE_DMA_BOUNDARY	0
+#endif
+#endif

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Fri Apr 19 13:23:41 2019	(r346385)
+++ head/sys/dev/pci/pci.c	Fri Apr 19 13:43:33 2019	(r346386)
@@ -4343,9 +4343,6 @@ pci_attach_common(device_t dev)
 {
 	struct pci_softc *sc;
 	int busno, domain;
-#ifdef PCI_DMA_BOUNDARY
-	int error, tag_valid;
-#endif
 #ifdef PCI_RES_BUS
 	int rid;
 #endif
@@ -4365,23 +4362,7 @@ pci_attach_common(device_t dev)
 	if (bootverbose)
 		device_printf(dev, "domain=%d, physical bus=%d\n",
 		    domain, busno);
-#ifdef PCI_DMA_BOUNDARY
-	tag_valid = 0;
-	if (device_get_devclass(device_get_parent(device_get_parent(dev))) !=
-	    devclass_find("pci")) {
-		error = bus_dma_tag_create(bus_get_dma_tag(dev), 1,
-		    PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
-		    NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED,
-		    BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag);
-		if (error)
-			device_printf(dev, "Failed to create DMA tag: %d\n",
-			    error);
-		else
-			tag_valid = 1;
-	}
-	if (!tag_valid)
-#endif
-		sc->sc_dma_tag = bus_get_dma_tag(dev);
+	sc->sc_dma_tag = bus_get_dma_tag(dev);
 	return (0);
 }
 

Modified: head/sys/dev/pci/pcivar.h
==============================================================================
--- head/sys/dev/pci/pcivar.h	Fri Apr 19 13:23:41 2019	(r346385)
+++ head/sys/dev/pci/pcivar.h	Fri Apr 19 13:43:33 2019	(r346386)
@@ -693,14 +693,6 @@ int	pcie_link_reset(device_t port, int pcie_location);
 
 void	pci_print_faulted_dev(void);
 
-#ifdef BUS_SPACE_MAXADDR
-#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF)
-#define	PCI_DMA_BOUNDARY	0x100000000
-#else
-#define	PCI_DMA_BOUNDARY	0
-#endif
-#endif
-
 #endif	/* _SYS_BUS_H_ */
 
 /*

Modified: head/sys/dev/twa/tw_osl.h
==============================================================================
--- head/sys/dev/twa/tw_osl.h	Fri Apr 19 13:23:41 2019	(r346385)
+++ head/sys/dev/twa/tw_osl.h	Fri Apr 19 13:43:33 2019	(r346386)
@@ -57,6 +57,12 @@
 #define TW_OSLI_MAX_NUM_IOS		(TW_OSLI_MAX_NUM_REQUESTS - 2)
 #define TW_OSLI_MAX_NUM_AENS		0x100
 
+#ifdef PAE
+#define	TW_OSLI_DMA_BOUNDARY		(1u << 31)
+#else
+#define	TW_OSLI_DMA_BOUNDARY		((bus_size_t)((uint64_t)1 << 32))
+#endif
+
 /* Possible values of req->state. */
 #define TW_OSLI_REQ_STATE_INIT		0x0	/* being initialized */
 #define TW_OSLI_REQ_STATE_BUSY		0x1	/* submitted to CL */

Modified: head/sys/dev/twa/tw_osl_freebsd.c
==============================================================================
--- head/sys/dev/twa/tw_osl_freebsd.c	Fri Apr 19 13:23:41 2019	(r346385)
+++ head/sys/dev/twa/tw_osl_freebsd.c	Fri Apr 19 13:43:33 2019	(r346386)
@@ -551,7 +551,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
 	/* Create the parent dma tag. */
 	if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* parent */
 				sc->alignment,		/* alignment */
-				0,			/* boundary */
+				TW_OSLI_DMA_BOUNDARY,	/* boundary */
 				BUS_SPACE_MAXADDR,	/* lowaddr */
 				BUS_SPACE_MAXADDR, 	/* highaddr */
 				NULL, NULL, 		/* filter, filterarg */

Modified: head/sys/x86/iommu/intel_ctx.c
==============================================================================
--- head/sys/x86/iommu/intel_ctx.c	Fri Apr 19 13:23:41 2019	(r346385)
+++ head/sys/x86/iommu/intel_ctx.c	Fri Apr 19 13:43:33 2019	(r346386)
@@ -130,7 +130,7 @@ ctx_tag_init(struct dmar_ctx *ctx, device_t dev)
 	maxaddr = MIN(ctx->domain->end, BUS_SPACE_MAXADDR);
 	ctx->ctx_tag.common.ref_count = 1; /* Prevent free */
 	ctx->ctx_tag.common.impl = &bus_dma_dmar_impl;
-	ctx->ctx_tag.common.boundary = PCI_DMA_BOUNDARY;
+	ctx->ctx_tag.common.boundary = 0;
 	ctx->ctx_tag.common.lowaddr = maxaddr;
 	ctx->ctx_tag.common.highaddr = maxaddr;
 	ctx->ctx_tag.common.maxsize = maxaddr;

From owner-svn-src-head@freebsd.org  Fri Apr 19 15:44:46 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 929DE15700F7;
 Fri, 19 Apr 2019 15:44:46 +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 348C68439E;
 Fri, 19 Apr 2019 15:44:46 +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 0AF01654;
 Fri, 19 Apr 2019 15:44:46 +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 x3JFijiq075970;
 Fri, 19 Apr 2019 15:44:45 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JFijLe075969;
 Fri, 19 Apr 2019 15:44:45 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201904191544.x3JFijLe075969@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Fri, 19 Apr 2019 15:44:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346390 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Commit-Revision: 346390
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 348C68439E
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.96)[-0.962,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, 19 Apr 2019 15:44:46 -0000

Author: mav
Date: Fri Apr 19 15:44:45 2019
New Revision: 346390
URL: https://svnweb.freebsd.org/changeset/base/346390

Log:
  Change the way FreeBSD GID inheritance is hacked.
  
  I believe previous ifdef caused NULL dereference in later zfs_log_create()
  on attempt to create file inside directory belonging to ephemeral group
  created on illumos, trying to write to log information about GID domain
  of the newly created file, inheriting the ephemeral GID.
  
  This patch reuses original illumos SGID code with exception that due to
  lack of ID mapping code on FreeBSD ephemeral GID will turn into GID_NOBODY
  by another ifdef inside zfs_fuid_map_id().
  
  MFC after:	1 month
  Sponsored by:	iXsystems, Inc.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Fri Apr 19 15:34:21 2019	(r346389)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Fri Apr 19 15:44:45 2019	(r346390)
@@ -1655,7 +1655,9 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va
 				acl_ids->z_fgid = 0;
 		}
 		if (acl_ids->z_fgid == 0) {
+#ifndef __FreeBSD_kernel__
 			if (dzp->z_mode & S_ISGID) {
+#endif
 				char		*domain;
 				uint32_t	rid;
 
@@ -1674,15 +1676,13 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va
 					    FUID_INDEX(acl_ids->z_fgid),
 					    acl_ids->z_fgid, ZFS_GROUP);
 				}
+#ifndef __FreeBSD_kernel__
 			} else {
 				acl_ids->z_fgid = zfs_fuid_create_cred(zfsvfs,
 				    ZFS_GROUP, cr, &acl_ids->z_fuidp);
-#ifdef __FreeBSD_kernel__
-				gid = acl_ids->z_fgid = dzp->z_gid;
-#else
 				gid = crgetgid(cr);
-#endif
 			}
+#endif
 		}
 	}
 

From owner-svn-src-head@freebsd.org  Fri Apr 19 17:06:45 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E8301572AF2;
 Fri, 19 Apr 2019 17:06:45 +0000 (UTC) (envelope-from thj@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 9C81487F92;
 Fri, 19 Apr 2019 17:06:44 +0000 (UTC) (envelope-from thj@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 774691524;
 Fri, 19 Apr 2019 17:06:44 +0000 (UTC) (envelope-from thj@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JH6iDI019619;
 Fri, 19 Apr 2019 17:06:44 GMT (envelope-from thj@FreeBSD.org)
Received: (from thj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JH6hGF019614;
 Fri, 19 Apr 2019 17:06:43 GMT (envelope-from thj@FreeBSD.org)
Message-Id: <201904191706.x3JH6hGF019614@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org
 using -f
From: Tom Jones 
Date: Fri, 19 Apr 2019 17:06:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346398 - in head: sys/netinet6 usr.bin/netstat
 usr.bin/systat
X-SVN-Group: head
X-SVN-Commit-Author: thj
X-SVN-Commit-Paths: in head: sys/netinet6 usr.bin/netstat usr.bin/systat
X-SVN-Commit-Revision: 346398
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 9C81487F92
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];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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, 19 Apr 2019 17:06:45 -0000

Author: thj
Date: Fri Apr 19 17:06:43 2019
New Revision: 346398
URL: https://svnweb.freebsd.org/changeset/base/346398

Log:
  Add stat counter for ipv6 atomic fragments
  
  Add a stat counter to track ipv6 atomic fragments. Atomic fragments can be
  generated in response to invalid path MTU values, but are also a potential
  attack vector and considered harmful (see RFC6946 and RFC8021).
  
  While here add tracking of the atomic fragment counter to netstat and systat.
  
  Reviewed by:    tuexen, jtl, bz
  Approved by:    jtl (mentor), bz (mentor)
  Event:  Aberdeen hackathon 2019
  Differential Revision:  https://reviews.freebsd.org/D17511

Modified:
  head/sys/netinet6/frag6.c
  head/sys/netinet6/ip6_var.h
  head/usr.bin/netstat/inet6.c
  head/usr.bin/systat/ip6.c

Modified: head/sys/netinet6/frag6.c
==============================================================================
--- head/sys/netinet6/frag6.c	Fri Apr 19 15:54:32 2019	(r346397)
+++ head/sys/netinet6/frag6.c	Fri Apr 19 17:06:43 2019	(r346398)
@@ -277,12 +277,12 @@ frag6_input(struct mbuf **mp, int *offp, int proto)
 	offset += sizeof(struct ip6_frag);
 
 	/*
-	 * RFC 6946: Handle "atomic" fragments (offset and m bit set to 0)
-	 * upfront, unrelated to any reassembly.  Just skip the fragment header.
+	 * Handle "atomic" fragments (offset and m bit set to 0) upfront,
+	 * unrelated to any reassembly (see RFC 6946 and section 4.5 of RFC
+	 * 8200).  Just skip the fragment header.
 	 */
 	if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) {
-		/* XXX-BZ we want dedicated counters for this. */
-		IP6STAT_INC(ip6s_reassembled);
+		IP6STAT_INC(ip6s_atomicfrags);
 		in6_ifstat_inc(dstifp, ifs6_reass_ok);
 		*offp = offset;
 		m->m_flags |= M_FRAGMENTED;

Modified: head/sys/netinet6/ip6_var.h
==============================================================================
--- head/sys/netinet6/ip6_var.h	Fri Apr 19 15:54:32 2019	(r346397)
+++ head/sys/netinet6/ip6_var.h	Fri Apr 19 17:06:43 2019	(r346398)
@@ -208,6 +208,7 @@ struct	ip6stat {
 	uint64_t ip6s_localout;		/* total ip packets generated here */
 	uint64_t ip6s_odropped;		/* lost packets due to nobufs, etc. */
 	uint64_t ip6s_reassembled;	/* total packets reassembled ok */
+	uint64_t ip6s_atomicfrags;	/* atomic fragments */
 	uint64_t ip6s_fragmented;	/* datagrams successfully fragmented */
 	uint64_t ip6s_ofragments;	/* output fragments created */
 	uint64_t ip6s_cantfrag;		/* don't fragment flag was set, etc. */

Modified: head/usr.bin/netstat/inet6.c
==============================================================================
--- head/usr.bin/netstat/inet6.c	Fri Apr 19 15:54:32 2019	(r346397)
+++ head/usr.bin/netstat/inet6.c	Fri Apr 19 17:06:43 2019	(r346398)
@@ -391,6 +391,8 @@ ip6_stats(u_long off, const char *name, int af1 __unus
 	    "{N:/fragment%s dropped after timeout}\n");
 	p(ip6s_fragoverflow, "\t{:dropped-fragments-overflow/%ju} "
 	    "{N:/fragment%s that exceeded limit}\n");
+	p(ip6s_atomicfrags, "\t{:atomic-fragments/%ju} "
+	    "{N:/atomic fragment%s}\n");
 	p(ip6s_reassembled, "\t{:reassembled-packets/%ju} "
 	    "{N:/packet%s reassembled ok}\n");
 	p(ip6s_delivered, "\t{:received-local-packets/%ju} "

Modified: head/usr.bin/systat/ip6.c
==============================================================================
--- head/usr.bin/systat/ip6.c	Fri Apr 19 15:54:32 2019	(r346397)
+++ head/usr.bin/systat/ip6.c	Fri Apr 19 17:06:43 2019	(r346398)
@@ -121,16 +121,16 @@ labelip6(void)
 	L(6, "- fragments dropped");	R(6, "destinations unreachable");
 	L(7, "- fragments timed out");	R(7, "packets output via raw IP");
 	L(8, "- fragments overflown");
-	L(9, "- packets reassembled ok"); R(9, "Input next-header histogram");
-	L(10, "packets forwarded");	R(10, " - destination options");
-	L(11, "- unreachable dests");	R(11, " - hop-by-hop options");
-	L(12, "- redirects generated");	R(12, " - IPv4");
-	L(13, "option errors");		R(13, " - TCP");
-	L(14, "unwanted multicasts");	R(14, " - UDP");
-	L(15, "delivered to upper layer"); R(15, " - IPv6");
-	L(16, "bad scope packets");	R(16, " - routing header");
-	L(17, "address selection failed"); R(17, " - fragmentation header");
-					R(18, " - ICMP6");
+	L(9, "- atomic fragments"); 	R(9, "Input next-header histogram");
+	L(10, "- packets reassembled ok"); R(10, " - destination options");
+	L(11, "packets forwarded");	R(11, " - hop-by-hop options");
+	L(12, "- unreachable dests");	R(12, " - IPv4");
+	L(13, "- redirects generated");	R(13, " - TCP");
+	L(14, "option errors");		R(14, " - UDP");
+	L(15, "unwanted multicasts");	R(15, " - IPv6");
+	L(16, "delivered to upper layer"); R(16, " - routing header");
+	L(17, "bad scope packets");	R(17, " - fragmentation header");
+	L(18, "address selection failed");R(18, " - ICMP6");
 					R(19, " - none");
 #undef L
 #undef R
@@ -165,6 +165,7 @@ domode(struct ip6stat *ret)
 	DO(ip6s_fragdropped);
 	DO(ip6s_fragtimeout);
 	DO(ip6s_fragoverflow);
+	DO(ip6s_atomicfrags);
 	DO(ip6s_forward);
 	DO(ip6s_cantforward);
 	DO(ip6s_redirectsent);
@@ -214,22 +215,23 @@ showip6(void)
 	DO(ip6s_fragtimeout, 7, 0);
 	DO(ip6s_rawout, 7, 35);
 	DO(ip6s_fragoverflow, 8, 0);
-	DO(ip6s_reassembled, 9, 0);
-	DO(ip6s_forward, 10, 0);
+	DO(ip6s_atomicfrags, 9, 0);
+	DO(ip6s_reassembled, 10, 0);
+	DO(ip6s_forward, 11, 0);
 	DO(ip6s_nxthist[IPPROTO_DSTOPTS], 10, 35);
-	DO(ip6s_cantforward, 11, 0);
+	DO(ip6s_cantforward, 12, 0);
 	DO(ip6s_nxthist[IPPROTO_HOPOPTS], 11, 35);
-	DO(ip6s_redirectsent, 12, 0);
+	DO(ip6s_redirectsent, 13, 0);
 	DO(ip6s_nxthist[IPPROTO_IPV4], 12, 35);
-	DO(ip6s_badoptions, 13, 0);
+	DO(ip6s_badoptions, 14, 0);
 	DO(ip6s_nxthist[IPPROTO_TCP], 13, 35);
-	DO(ip6s_notmember, 14, 0);
+	DO(ip6s_notmember, 15, 0);
 	DO(ip6s_nxthist[IPPROTO_UDP], 14, 35);
-	DO(ip6s_delivered, 15, 0);
+	DO(ip6s_delivered, 16, 0);
 	DO(ip6s_nxthist[IPPROTO_IPV6], 15, 35);
-	DO(ip6s_badscope, 16, 0);
+	DO(ip6s_badscope, 17, 0);
 	DO(ip6s_nxthist[IPPROTO_ROUTING], 16, 35);
-	DO(ip6s_sources_none, 17, 0);
+	DO(ip6s_sources_none, 18, 0);
 	DO(ip6s_nxthist[IPPROTO_FRAGMENT], 17, 35);
 	DO(ip6s_nxthist[IPPROTO_ICMPV6], 18, 35);
 	DO(ip6s_nxthist[IPPROTO_NONE], 19, 35);

From owner-svn-src-head@freebsd.org  Fri Apr 19 17:15:59 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4950E1572D96;
 Fri, 19 Apr 2019 17:15:59 +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 E36798841A;
 Fri, 19 Apr 2019 17:15:58 +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 BC00916F3;
 Fri, 19 Apr 2019 17:15:58 +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 x3JHFwwE025095;
 Fri, 19 Apr 2019 17:15:58 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JHFwhC025094;
 Fri, 19 Apr 2019 17:15:58 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201904191715.x3JHFwhC025094@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Fri, 19 Apr 2019 17:15:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346399 - head/share/man/man4
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/share/man/man4
X-SVN-Commit-Revision: 346399
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: E36798841A
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.978,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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, 19 Apr 2019 17:15:59 -0000

Author: cem
Date: Fri Apr 19 17:15:58 2019
New Revision: 346399
URL: https://svnweb.freebsd.org/changeset/base/346399

Log:
  random.4: Include description of knobs added in r346358
  
  Reported by:	ngie
  Sponsored by:	Dell EMC Isilon

Modified:
  head/share/man/man4/random.4

Modified: head/share/man/man4/random.4
==============================================================================
--- head/share/man/man4/random.4	Fri Apr 19 17:06:43 2019	(r346398)
+++ head/share/man/man4/random.4	Fri Apr 19 17:15:58 2019	(r346399)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 15, 2019
+.Dd April 19, 2019
 .Dt RANDOM 4
 .Os
 .Sh NAME
@@ -85,6 +85,10 @@ kern.random.harvest.mask_bin: 00000010000000111011111
 kern.random.harvest.mask: 66015
 kern.random.use_chacha20_cipher: 0
 kern.random.random_sources: 'Intel Secure Key RNG'
+kern.random.initial_seeding.bypass_before_seeding: 1
+kern.random.initial_seeding.read_random_bypassed_before_seeding: 0
+kern.random.initial_seeding.arc4random_bypassed_before_seeding: 0
+kern.random.initial_seeding.disable_bypass_warnings: 0
 .Ed
 .Pp
 Other than
@@ -132,6 +136,55 @@ for more on the harvesting of entropy.
 .Bl -tag -width ".Pa /dev/urandom"
 .It Pa /dev/random
 .It Pa /dev/urandom
+.El
+.Sh DIAGNOSTICS
+The following tunables are related to initial seeding of the
+.Nm
+device:
+.Bl -tag -width 4
+.It Va kern.random.initial_seeding.bypass_before_seeding
+Defaults to 1 (on).
+When set, the system will bypass the
+.Nm
+device prior to initial seeding.
+On is
+.Em unsafe ,
+but provides availability on many systems that lack early sources
+of entropy, or cannot load
+.Pa /boot/entropy
+sufficiently early in boot for
+.Nm
+consumers.
+When unset (0), the system will block
+.Xr read_random 9
+and
+.Xr arc4random 9
+requests if and until the
+.Nm
+device is initially seeded.
+.It Va kern.random.initial_seeding.disable_bypass_warnings
+Defaults to 0 (off).
+When set non-zero, disables warnings in dmesg when the
+.Nm
+device is bypassed.
+.El
+.Pp
+The following read-only
+.Xr sysctl 8
+variables allow programmatic diagnostic of whether
+.Nm
+device bypass occurred during boot.
+If they are set (non-zero), the specific functional unit bypassed the strong
+.Nm
+device output and either produced no output
+.Xr ( read_random 9 )
+or seeded itself with minimal, non-cryptographic entropy
+.Xr ( arc4random 9 ) .
+.Bl -bullet
+.It
+.Va kern.random.initial_seeding.read_random_bypassed_before_seeding
+.It
+.Va kern.random.initial_seeding.arc4random_bypassed_before_seeding
 .El
 .Sh SEE ALSO
 .Xr getrandom 2 ,

From owner-svn-src-head@freebsd.org  Fri Apr 19 17:17:43 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F15B61572F6C;
 Fri, 19 Apr 2019 17:17:42 +0000 (UTC)
 (envelope-from tuexen@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 9262B88780;
 Fri, 19 Apr 2019 17:17:42 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6803716F6;
 Fri, 19 Apr 2019 17:17:42 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JHHgT2025422;
 Fri, 19 Apr 2019 17:17:42 GMT (envelope-from tuexen@FreeBSD.org)
Received: (from tuexen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JHHg24025421;
 Fri, 19 Apr 2019 17:17:42 GMT (envelope-from tuexen@FreeBSD.org)
Message-Id: <201904191717.x3JHHg24025421@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: tuexen set sender to
 tuexen@FreeBSD.org using -f
From: Michael Tuexen 
Date: Fri, 19 Apr 2019 17:17:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346400 - head/sys/netinet6
X-SVN-Group: head
X-SVN-Commit-Author: tuexen
X-SVN-Commit-Paths: head/sys/netinet6
X-SVN-Commit-Revision: 346400
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 9262B88780
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.978,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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, 19 Apr 2019 17:17:43 -0000

Author: tuexen
Date: Fri Apr 19 17:17:41 2019
New Revision: 346400
URL: https://svnweb.freebsd.org/changeset/base/346400

Log:
  Improve input validation for the socket option IPV6_CHECKSUM.
  
  When using the IPPROTO_IPV6 level socket option IPV6_CHECKSUM on a raw
  IPv6 socket, ensure that the value is either -1 or a non-negative even
  number.
  
  Reviewed by:		bz@, thj@
  MFC after:		1 week
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D19966

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c	Fri Apr 19 17:15:58 2019	(r346399)
+++ head/sys/netinet6/ip6_output.c	Fri Apr 19 17:17:41 2019	(r346400)
@@ -2221,8 +2221,11 @@ ip6_raw_ctloutput(struct socket *so, struct sockopt *s
 					    sizeof(optval));
 			if (error)
 				break;
-			if ((optval % 2) != 0) {
-				/* the API assumes even offset values */
+			if (optval < -1 || (optval % 2) != 0) {
+				/*
+				 * The API assumes non-negative even offset
+				 * values or -1 as a special value.
+				 */
 				error = EINVAL;
 			} else if (so->so_proto->pr_protocol ==
 			    IPPROTO_ICMPV6) {

From owner-svn-src-head@freebsd.org  Fri Apr 19 17:21:37 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34E5A157323C;
 Fri, 19 Apr 2019 17:21:37 +0000 (UTC)
 (envelope-from tuexen@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 CCEBD88D73;
 Fri, 19 Apr 2019 17:21:36 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47B5F1763;
 Fri, 19 Apr 2019 17:21:36 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JHLaef027930;
 Fri, 19 Apr 2019 17:21:36 GMT (envelope-from tuexen@FreeBSD.org)
Received: (from tuexen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JHLa7F027929;
 Fri, 19 Apr 2019 17:21:36 GMT (envelope-from tuexen@FreeBSD.org)
Message-Id: <201904191721.x3JHLa7F027929@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: tuexen set sender to
 tuexen@FreeBSD.org using -f
From: Michael Tuexen 
Date: Fri, 19 Apr 2019 17:21:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346401 - head/sys/netinet6
X-SVN-Group: head
X-SVN-Commit-Author: tuexen
X-SVN-Commit-Paths: head/sys/netinet6
X-SVN-Commit-Revision: 346401
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: CCEBD88D73
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.948,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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, 19 Apr 2019 17:21:37 -0000

Author: tuexen
Date: Fri Apr 19 17:21:35 2019
New Revision: 346401
URL: https://svnweb.freebsd.org/changeset/base/346401

Log:
  Avoid a buffer overwrite in rip6_output() when computing the checksum
  as requested by the user via the IPPROTO_IPV6 level socket option
  IPV6_CHECKSUM. The check if there are enough bytes in the packet to
  store the checksum at the requested offset was wrong by 1.
  
  Reviewed by:		bz@
  MFC after:		1 week
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D19967

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Fri Apr 19 17:17:41 2019	(r346400)
+++ head/sys/netinet6/raw_ip6.c	Fri Apr 19 17:21:35 2019	(r346401)
@@ -495,7 +495,7 @@ rip6_output(struct mbuf *m, struct socket *so, ...)
 			off = offsetof(struct icmp6_hdr, icmp6_cksum);
 		else
 			off = in6p->in6p_cksum;
-		if (plen < off + 1) {
+		if (plen < off + 2) {
 			error = EINVAL;
 			goto bad;
 		}

From owner-svn-src-head@freebsd.org  Fri Apr 19 17:28:29 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEE1157368E;
 Fri, 19 Apr 2019 17:28:29 +0000 (UTC)
 (envelope-from tuexen@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 04DCE890FC;
 Fri, 19 Apr 2019 17:28:29 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF31418D4;
 Fri, 19 Apr 2019 17:28:28 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JHSS2X030567;
 Fri, 19 Apr 2019 17:28:28 GMT (envelope-from tuexen@FreeBSD.org)
Received: (from tuexen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JHSSR4030566;
 Fri, 19 Apr 2019 17:28:28 GMT (envelope-from tuexen@FreeBSD.org)
Message-Id: <201904191728.x3JHSSR4030566@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: tuexen set sender to
 tuexen@FreeBSD.org using -f
From: Michael Tuexen 
Date: Fri, 19 Apr 2019 17:28:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346402 - head/sys/netinet6
X-SVN-Group: head
X-SVN-Commit-Author: tuexen
X-SVN-Commit-Paths: head/sys/netinet6
X-SVN-Commit-Revision: 346402
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 04DCE890FC
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.948,0];
 NEURAL_HAM_LONG(-1.00)[-1.000,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, 19 Apr 2019 17:28:29 -0000

Author: tuexen
Date: Fri Apr 19 17:28:28 2019
New Revision: 346402
URL: https://svnweb.freebsd.org/changeset/base/346402

Log:
  When a checksum has to be computed for a received IPv6 packet because it
  is requested by the application using the IPPROTO_IPV6 level socket option
  IPV6_CHECKSUM on a raw socket, ensure that the packet contains enough
  bytes to contain the checksum at the specified offset.
  
  Reported by:		syzbot+6295fcc5a8aced81d599@syzkaller.appspotmail.com
  Reviewed by:		bz@
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D19968

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Fri Apr 19 17:21:35 2019	(r346401)
+++ head/sys/netinet6/raw_ip6.c	Fri Apr 19 17:28:28 2019	(r346402)
@@ -239,7 +239,8 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
 		}
 		if (in6p->in6p_cksum != -1) {
 			RIP6STAT_INC(rip6s_isum);
-			if (in6_cksum(m, proto, *offp,
+			if (m->m_pkthdr.len - (*offp + in6p->in6p_cksum) < 2 ||
+			    in6_cksum(m, proto, *offp,
 			    m->m_pkthdr.len - *offp)) {
 				RIP6STAT_INC(rip6s_badsum);
 				goto skip_2;

From owner-svn-src-head@freebsd.org  Fri Apr 19 17:51:28 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B77C21573F39;
 Fri, 19 Apr 2019 17:51:28 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com
 [IPv6:2607:f8b0:4864:20::52a])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 139D889F27;
 Fri, 19 Apr 2019 17:51:28 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pg1-x52a.google.com with SMTP id l18so2815746pgj.6;
 Fri, 19 Apr 2019 10:51:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=dNtxEoEQL9EVvT5VuE+S9u4YzS/mGn6WvwxfWJA/U6U=;
 b=WNkXlCKnwpdnUeVcskZu8Zrg551L2zlb8uu1R36ApjRW6oOWpA15163WNOIMKh1EsR
 EmavImOhwXgnAp8qFPlM4PUJmgxkJrN0XaDJspjHJGHM7bRC2yIGqoZp66GEIvJ+UFGK
 qsbVdcqDfSFrD1jHEWxAk3ux1U1pXR+/bvlalP7/fu+b2+KWKQMrifBSujtEudx4mUjN
 coieSTvpkkiPnEx4kMtRrWruXCa8tp5lUYRArm+erJg/Zfmr5JvPwY1fcNPnAEnIJdBq
 MixyezYZtNyl2wGJjJiDjB1ia1DIoJ0xLzw2IbEptZvJxeXW2jRWJ/QL4yYeHAIHCIAC
 zCvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=dNtxEoEQL9EVvT5VuE+S9u4YzS/mGn6WvwxfWJA/U6U=;
 b=dAolEcmrrqkAYR1pby0a2OugEn2mJAymLOCBuRkKOqzPU3md545HnMrm6ZoxJGiwQw
 AzQjlhZ9pzCEJPzLoOdry8iyYjrHmf6Y1scA0v0qXsqzOmx7iyrRm2rDBDgrjqvhRkQN
 vjGTPkPoRA2tTbfREFlKY232wJmohPho8fcDhcY+GYxNkI982ai19vTX3/Y2BFaHyzl2
 MryTSVQT440zvbOWvfWMNOGbNMyoBe+sTh2CK1p0mxj+T+8Bo7BZ9iCJ3x8EmhG4HfnY
 izgiJFnsldgIWHYtcpRicwEC4c5Vq5UIyArJip52ACK3VOyaX9gTwrtm5ICbIMuzCnMr
 IKyA==
X-Gm-Message-State: APjAAAVr5veElLF6pzTo9GrFlnIt+T1UNZC9ChfBPkOkvwXfG9pK/yNo
 SuGJZ+9NlRiKYoSzb1ZPvXU9HkIQ38Q=
X-Google-Smtp-Source: APXvYqz+IRGmNeO1DdmYOK6sL/3Q8CiJSh8esfAq6SNAacE0dy0tQZKPD8G7r70VahnXQuLm2WS8+g==
X-Received: by 2002:a62:4d43:: with SMTP id a64mr5258345pfb.174.1555696285372; 
 Fri, 19 Apr 2019 10:51:25 -0700 (PDT)
Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id s19sm6832923pfe.74.2019.04.19.10.51.24
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 19 Apr 2019 10:51:24 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (1.0)
Subject: Re: svn commit: r346399 - head/share/man/man4
From: Enji Cooper 
X-Mailer: iPhone Mail (16E227)
In-Reply-To: <201904191715.x3JHFwhC025094@repo.freebsd.org>
Date: Fri, 19 Apr 2019 10:51:24 -0700
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201904191715.x3JHFwhC025094@repo.freebsd.org>
To: Conrad Meyer 
X-Rspamd-Queue-Id: 139D889F27
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]; 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, 19 Apr 2019 17:51:28 -0000


> On Apr 19, 2019, at 10:15, Conrad Meyer  wrote:
>=20
> Author: cem
> Date: Fri Apr 19 17:15:58 2019
> New Revision: 346399
> URL: https://svnweb.freebsd.org/changeset/base/346399
>=20
> Log:
>  random.4: Include description of knobs added in r346358
>=20
>  Reported by:    ngie
>  Sponsored by:    Dell EMC Isilon

Thank you so very much Conrad \^O^/!!! You=E2=80=99re awesome!
-Enji=

From owner-svn-src-head@freebsd.org  Fri Apr 19 18:00:34 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F2415741E1;
 Fri, 19 Apr 2019 18:00:34 +0000 (UTC)
 (envelope-from adrian@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 3B3698A404;
 Fri, 19 Apr 2019 18:00:34 +0000 (UTC)
 (envelope-from adrian@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 083FB1E33;
 Fri, 19 Apr 2019 18:00:34 +0000 (UTC)
 (envelope-from adrian@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JI0XjX047530;
 Fri, 19 Apr 2019 18:00:33 GMT (envelope-from adrian@FreeBSD.org)
Received: (from adrian@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JI0XkQ047529;
 Fri, 19 Apr 2019 18:00:33 GMT (envelope-from adrian@FreeBSD.org)
Message-Id: <201904191800.x3JI0XkQ047529@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: adrian set sender to
 adrian@FreeBSD.org using -f
From: Adrian Chadd 
Date: Fri, 19 Apr 2019 18:00:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346405 - head/sys/dev/ath
X-SVN-Group: head
X-SVN-Commit-Author: adrian
X-SVN-Commit-Paths: head/sys/dev/ath
X-SVN-Commit-Revision: 346405
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 3B3698A404
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];
 NEURAL_HAM_LONG(-1.00)[-1.000,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, 19 Apr 2019 18:00:34 -0000

Author: adrian
Date: Fri Apr 19 18:00:33 2019
New Revision: 346405
URL: https://svnweb.freebsd.org/changeset/base/346405

Log:
  [ath] Fix return value check to not complain.
  
  Compilers complain more about things, so let's keep them happy.

Modified:
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Fri Apr 19 17:29:20 2019	(r346404)
+++ head/sys/dev/ath/if_athvar.h	Fri Apr 19 18:00:33 2019	(r346405)
@@ -1352,7 +1352,7 @@ void	ath_intr(void *);
 	== HAL_OK)
 #define	ath_hal_setrxbufsize(_ah, _req) \
 	(ath_hal_setcapability(_ah, HAL_CAP_RXBUFSIZE, 0, _req, NULL)	\
-	== HAL_OK)
+	== AH_TRUE)
 
 #define	ath_hal_getchannoise(_ah, _c) \
 	((*(_ah)->ah_getChanNoise)((_ah), (_c)))

From owner-svn-src-head@freebsd.org  Fri Apr 19 18:09:39 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4B7A15745A0;
 Fri, 19 Apr 2019 18:09:38 +0000 (UTC)
 (envelope-from tuexen@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 887658AC2C;
 Fri, 19 Apr 2019 18:09:38 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C4221FE6;
 Fri, 19 Apr 2019 18:09:38 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JI9cA5051691;
 Fri, 19 Apr 2019 18:09:38 GMT (envelope-from tuexen@FreeBSD.org)
Received: (from tuexen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JI9chr051690;
 Fri, 19 Apr 2019 18:09:38 GMT (envelope-from tuexen@FreeBSD.org)
Message-Id: <201904191809.x3JI9chr051690@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: tuexen set sender to
 tuexen@FreeBSD.org using -f
From: Michael Tuexen 
Date: Fri, 19 Apr 2019 18:09:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346406 - head/sys/netinet6
X-SVN-Group: head
X-SVN-Commit-Author: tuexen
X-SVN-Commit-Paths: head/sys/netinet6
X-SVN-Commit-Revision: 346406
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 887658AC2C
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_LONG(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.94)[-0.937,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, 19 Apr 2019 18:09:39 -0000

Author: tuexen
Date: Fri Apr 19 18:09:37 2019
New Revision: 346406
URL: https://svnweb.freebsd.org/changeset/base/346406

Log:
  When an IPv6 packet is received for a raw socket which has the
  IPPROTO_IPV6 level socket option IPV6_CHECKSUM enabled and the
  checksum check fails, drop the message. Without this fix, an
  ICMP6 message was sent indicating a parameter problem.
  
  Thanks to bz@ for suggesting a way to simplify this fix.
  
  Reviewed by:		bz@
  MFC after:		1 week
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D19969

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Fri Apr 19 18:00:33 2019	(r346405)
+++ head/sys/netinet6/raw_ip6.c	Fri Apr 19 18:09:37 2019	(r346406)
@@ -243,6 +243,12 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
 			    in6_cksum(m, proto, *offp,
 			    m->m_pkthdr.len - *offp)) {
 				RIP6STAT_INC(rip6s_badsum);
+				/*
+				 * Drop the received message, don't send an
+				 * ICMP6 message. Set proto to IPPROTO_NONE
+				 * to achieve that.
+				 */
+				proto = IPPROTO_NONE;
 				goto skip_2;
 			}
 		}

From owner-svn-src-head@freebsd.org  Fri Apr 19 18:09:50 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24D0E15745CB;
 Fri, 19 Apr 2019 18:09:50 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com
 [IPv6:2607:f8b0:4864:20::444])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 884D88AD1D;
 Fri, 19 Apr 2019 18:09:49 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pf1-x444.google.com with SMTP id 9so2852643pfj.13;
 Fri, 19 Apr 2019 11:09:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=bUi1cu7Htl3Gsf7hhYKZ6yb5ttLVV3vhNIcPOJovSA4=;
 b=GzBbYWmXlZ4GRsuuaEYvtF85flKpQ9I0Hf+y1sbsTj++qofEAXF6vsAbODbJZvMrMK
 m+XBmwiPvaWJIuhnRac/SvPpjvxxd7V1grvXEIrkek7AIXr0u1z2rQPusyQGj/sboX5d
 M7VRn/g5Ao+OjWScEmQyiNW/PwVE5l7FJDFwS9yG1iobYxUD7nBd+BBW00iuG3/QmVED
 ZW+DsEtJHCriFVXrXRM5nuplz78DjFYGhqQI3PKAMyRI/hYmiJCo09YsV/pq4c9ZqvXD
 jROA+Cfhl1jUukzo4Xj8K1vyeLQrkhmrc56JFRgDxGihZayhlEctS57aZllzbdE+oqT0
 T4nw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=bUi1cu7Htl3Gsf7hhYKZ6yb5ttLVV3vhNIcPOJovSA4=;
 b=TA1MbeEcudhpT8CyO+5Urd8R4yaFDqcJtvvVutHI3iV/MDoTCpKXYf2VlmQNzYvxik
 eaB1E+V9/+QBBxcbQN3IfvSclFuKK+matjsB3HAlYTYIo53et3jsOfSawViPk4EfyiwD
 4D1ngCFzMZfKfBO9LTn2O7bf0B7+TdIxS8eV4qbW+s2+un8oavTgrkAoVaD7f+ueZ3WG
 HHtcX58i4GUIsl3Noj4xI56TC1ReCkMhcmDRxJMsoOLe+H+I+5CzNhj9LyrzYz/awEbJ
 RkZd2FmFwdHvpsWl2OQ7gUwbXhL/+TD+9OW57iGz07PovIfA5ZcatA4XDFTjb1D+a8eI
 MOOQ==
X-Gm-Message-State: APjAAAV6IDRkvAiS7F9bMJIZ0tXqKNp+D5Gx7V36rKIMbZNwlpNixW04
 0SMtMKgjTPYm9G6QmiSUpDVcJqea7BA=
X-Google-Smtp-Source: APXvYqxjlI7JatWvfMCnsrD8ZSzVsayUgOpg5lnZOA5WDr7dGjggjbzFN5BfXot1ZwkzGV9BtuDcdw==
X-Received: by 2002:a62:2046:: with SMTP id g67mr5237676pfg.121.1555697385058; 
 Fri, 19 Apr 2019 11:09:45 -0700 (PDT)
Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id z22sm5566873pgv.23.2019.04.19.11.09.44
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 19 Apr 2019 11:09:44 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (1.0)
Subject: Re: svn commit: r346390 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
From: Enji Cooper 
X-Mailer: iPhone Mail (16E227)
In-Reply-To: <201904191544.x3JFijLe075969@repo.freebsd.org>
Date: Fri, 19 Apr 2019 11:09:43 -0700
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <0F708A9C-D29D-466A-B541-06DB7127349E@gmail.com>
References: <201904191544.x3JFijLe075969@repo.freebsd.org>
To: Alexander Motin 
X-Rspamd-Queue-Id: 884D88AD1D
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.94 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.94)[-0.935,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, 19 Apr 2019 18:09:50 -0000


> On Apr 19, 2019, at 08:44, Alexander Motin  wrote:
>=20
> Author: mav
> Date: Fri Apr 19 15:44:45 2019
> New Revision: 346390
> URL: https://svnweb.freebsd.org/changeset/base/346390
>=20
> Log:
>  Change the way FreeBSD GID inheritance is hacked.
>=20
>  I believe previous ifdef caused NULL dereference in later zfs_log_create(=
)
>  on attempt to create file inside directory belonging to ephemeral group
>  created on illumos, trying to write to log information about GID domain
>  of the newly created file, inheriting the ephemeral GID.
>=20
>  This patch reuses original illumos SGID code with exception that due to
>  lack of ID mapping code on FreeBSD ephemeral GID will turn into GID_NOBOD=
Y
>  by another ifdef inside zfs_fuid_map_id().

Hi mav@!
    I was wondering, does this break ACL mappings with sticky bits for the g=
roup ID (or was it broken to begin with)? If the latter, does it make sense t=
o file a bug/add a TODO comment?
Thank you!
-Enji=

From owner-svn-src-head@freebsd.org  Fri Apr 19 18:29:25 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D6C1575033;
 Fri, 19 Apr 2019 18:29:25 +0000 (UTC)
 (envelope-from mavbsd@gmail.com)
Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com
 [IPv6:2607:f8b0:4864:20::c44])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 544A08BBDE;
 Fri, 19 Apr 2019 18:29:25 +0000 (UTC)
 (envelope-from mavbsd@gmail.com)
Received: by mail-yw1-xc44.google.com with SMTP id e76so2155849ywa.9;
 Fri, 19 Apr 2019 11:29:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=jp/VuxaLW34EsE/Yf4J6pEZU7qLK4ot8gNmmzGE8XkI=;
 b=BKvu7bdIwbtl0HfRKdSZZOVzS3znqQLqsJZfTS6+HJD7kfZk1AhE4y/WHgfxQKCotO
 gHov4vq3oJRvwQdkeHXVX23DPvIOYHlmPqT68fYAir6MtsreM1I+b5HanEe9JNlVkGwO
 YmpOWcDmXZr1SWEcEbbu4qHa2wnjmgXRlTpbmPcnFOFvhxkQ/P3e9x53SGJ9Pjlu5hHF
 ujjrPfDS5qy5gvd6h/NyOMlX7HuAvCEg0p74M/5WYTNfx8iKnkqNNCV5DYVBT93z/1QC
 dxD04/VUgcEqoopjqKv02pXkBXruwZ+1qjXZ0Px3xUZmT1nxWHJoHjGkC6lY4w/Y53ys
 257Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp
 :autocrypt:message-id:date:user-agent:mime-version:in-reply-to
 :content-language:content-transfer-encoding;
 bh=jp/VuxaLW34EsE/Yf4J6pEZU7qLK4ot8gNmmzGE8XkI=;
 b=G7B+Mg4aSj8+iQPlnivXBRNUMSO/buEWN3mTNLHdcciTvQb+OmhmFhKPNu+Wy+21+G
 l79DeQplKIc6BdMFxuhrojNx165JIR4fjfCxZXsnvr8Pl9uWSCTJW4GbA0tYad84Dicb
 V58foL4xf+inwBx9unRrWcpNYGchnYti8S9U/W6XxrsXaU5TnajhnBETGFbhPkCwekOt
 r3Ragjt8LLsvzDi8ur0Lbs0nZyPIFNi5SfFXuyx1lOE40piBQMWMIP1nj7q2yLrZmZqL
 mgqVGkIktE23oyyI7/cuQnRMYGukO5kJQRzdVIUBYjlVvottPnKEGK55hPNs0zuf8nvd
 sDfw==
X-Gm-Message-State: APjAAAXvJASEPMlZVgUomCdcLfF+BUIb9wjq8TltmACqbxz/zrEkIiCa
 v6UElsjb9LFkgkqZoU6qUq8G2acQ
X-Google-Smtp-Source: APXvYqwieeEh78VhFzYGn3NjkoCuGZcf620dW8DqqeSrbu8szDgBt9qrErBWSl1C5gGBKYar2X6lZg==
X-Received: by 2002:a81:4c07:: with SMTP id z7mr4379331ywa.0.1555698564553;
 Fri, 19 Apr 2019 11:29:24 -0700 (PDT)
Received: from mavoffice.ixsystems.com ([12.189.233.129])
 by smtp.gmail.com with ESMTPSA id z193sm2001932ywa.70.2019.04.19.11.29.23
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 19 Apr 2019 11:29:24 -0700 (PDT)
Sender: Alexander Motin 
Subject: Re: svn commit: r346390 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
To: Enji Cooper 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
References: <201904191544.x3JFijLe075969@repo.freebsd.org>
 <0F708A9C-D29D-466A-B541-06DB7127349E@gmail.com>
From: Alexander Motin 
Openpgp: preference=signencrypt
Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata=
 xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g
 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne
 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP
 g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU
 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB
 AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH
 AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN
 McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm
 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y
 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z
 zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6
 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ
 Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z
 AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv
 mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt
 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ
 R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5
 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU
 fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3
 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW
 RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI
 W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL
 NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac
 w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA
 qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz
 gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg
 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza
 B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F
 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg==
Message-ID: <8d763a63-0915-d9f6-1b90-5e902f06ebe4@FreeBSD.org>
Date: Fri, 19 Apr 2019 14:29:23 -0400
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <0F708A9C-D29D-466A-B541-06DB7127349E@gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 544A08BBDE
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.94 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.94)[-0.936,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, 19 Apr 2019 18:29:26 -0000

On 19.04.2019 14:09, Enji Cooper wrote:
>> On Apr 19, 2019, at 08:44, Alexander Motin  wrote:
>>
>> Author: mav
>> Date: Fri Apr 19 15:44:45 2019
>> New Revision: 346390
>> URL: https://svnweb.freebsd.org/changeset/base/346390
>>
>> Log:
>>  Change the way FreeBSD GID inheritance is hacked.
>>
>>  I believe previous ifdef caused NULL dereference in later zfs_log_create()
>>  on attempt to create file inside directory belonging to ephemeral group
>>  created on illumos, trying to write to log information about GID domain
>>  of the newly created file, inheriting the ephemeral GID.
>>
>>  This patch reuses original illumos SGID code with exception that due to
>>  lack of ID mapping code on FreeBSD ephemeral GID will turn into GID_NOBODY
>>  by another ifdef inside zfs_fuid_map_id().
> 
> Hi mav@!
>     I was wondering, does this break ACL mappings with sticky bits for the group ID (or was it broken to begin with)? If the latter, does it make sense to file a bug/add a TODO comment?

I don't believe this change should have any visible results for native
FreeBSD pools.  It does change change handling of some pools coming from
illumos, but previous behavior in that case resulted in kernel panic, so
anything else is better, while full compatibility is impossible, since
FreeBSD has no kernel-side AD UID/GID mapping, used by illumos SMB.

Could you better describe what ACL mapping breakage you are talking about?

-- 
Alexander Motin

From owner-svn-src-head@freebsd.org  Fri Apr 19 18:34:13 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335A21575277;
 Fri, 19 Apr 2019 18:34:13 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com
 [IPv6:2607:f8b0:4864:20::444])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id ADA3C8C06B;
 Fri, 19 Apr 2019 18:34:12 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pf1-x444.google.com with SMTP id h5so2901049pfo.0;
 Fri, 19 Apr 2019 11:34:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=IiR/cve4fomaxs81NIJVeW1YfCiYPHkUKWOkNdQsIL4=;
 b=LUPqoSeVim7kJs0tznW3XkhbGPIHDDEDavDoz0uCgvE8aYMnpZ2cyp+5lvazrDfxe+
 I+eFI+sN9elVuNAhO9oxvkEvxV3n1dFDJfvRZk/viJyxSqs3PfM4A1/YwngEmRCliBy5
 EA+7+PNE/tgXaWSpdIxqsh5pORhRme9V0l3SwW9AK4LifToD3y1m7narFeJ/N5VkodgT
 jS4DthauB7Bs0rk1MNDBmyeG8u9LFIiKoqn9U5IuzGF1i4Ycv2Hhle1VYYsFZFpiPyTG
 /cvMId22S72Z7rRJz/K7MuPk0D8n6hJv2o31CSayfJYj79+FR73/ckpuP1kN9u3C++rp
 CF8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=IiR/cve4fomaxs81NIJVeW1YfCiYPHkUKWOkNdQsIL4=;
 b=lSonsJwY5nBaBqtJBhjd2TyePsCe2SqP72SgCJ4w91/ICeRQy183vEK2i6o3k98TNV
 TPplW3o+KkrzIbBrhDn5DVckjPBoY4Y/Nqub14k5p/AZUhc9+TDpa3+NKHCBZA30hyUe
 u8WxMNAUmiHL9h01uFqv5dCm2FwV7m21+HDCmm+wtY4Kth9FwIXjsOws7T4cK7e+k3YO
 FKoNHIGTfX83pkoI/L1Kyihfflo8nJwEYerExViImNmMK3suF46CtAx5oqPSGOJgOP0B
 4PxrdixTptJYil402Cg126tX1ILi1B7JN22h5DWJ+FWGnWcpjWC8RViqb1GK6kViZM9E
 TS0Q==
X-Gm-Message-State: APjAAAXzQsQrlJk/e8f/maha8gbpFxcZpUAH40e/tviH7pwVQRIwYvru
 t+LPPt5+1n8ajY/5lDOvNCLzQhEouho=
X-Google-Smtp-Source: APXvYqzxDoxJozIbv6AU0IpG4HyaHRp65II0xIVhbToTTcMcnap/BqXOf7NW49vUrFjmfgk/yo8xJw==
X-Received: by 2002:a63:28f:: with SMTP id 137mr5356941pgc.377.1555698851406; 
 Fri, 19 Apr 2019 11:34:11 -0700 (PDT)
Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id h8sm2722108pgd.42.2019.04.19.11.34.10
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 19 Apr 2019 11:34:10 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (1.0)
Subject: Re: svn commit: r346390 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
From: Enji Cooper 
X-Mailer: iPhone Mail (16E227)
In-Reply-To: <8d763a63-0915-d9f6-1b90-5e902f06ebe4@FreeBSD.org>
Date: Fri, 19 Apr 2019 11:34:10 -0700
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201904191544.x3JFijLe075969@repo.freebsd.org>
 <0F708A9C-D29D-466A-B541-06DB7127349E@gmail.com>
 <8d763a63-0915-d9f6-1b90-5e902f06ebe4@FreeBSD.org>
To: Alexander Motin 
X-Rspamd-Queue-Id: ADA3C8C06B
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.94 / 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.94)[-0.936,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, 19 Apr 2019 18:34:13 -0000


> On Apr 19, 2019, at 11:29, Alexander Motin  wrote:
>=20
> On 19.04.2019 14:09, Enji Cooper wrote:
>>> On Apr 19, 2019, at 08:44, Alexander Motin  wrote:
>>>=20
>>> Author: mav
>>> Date: Fri Apr 19 15:44:45 2019
>>> New Revision: 346390
>>> URL: https://svnweb.freebsd.org/changeset/base/346390
>>>=20
>>> Log:
>>> Change the way FreeBSD GID inheritance is hacked.
>>>=20
>>> I believe previous ifdef caused NULL dereference in later zfs_log_create=
()
>>> on attempt to create file inside directory belonging to ephemeral group
>>> created on illumos, trying to write to log information about GID domain
>>> of the newly created file, inheriting the ephemeral GID.
>>>=20
>>> This patch reuses original illumos SGID code with exception that due to
>>> lack of ID mapping code on FreeBSD ephemeral GID will turn into GID_NOBO=
DY
>>> by another ifdef inside zfs_fuid_map_id().
>>=20
>> Hi mav@!
>>    I was wondering, does this break ACL mappings with sticky bits for the=
 group ID (or was it broken to begin with)? If the latter, does it make sens=
e to file a bug/add a TODO comment?
>=20
> I don't believe this change should have any visible results for native
> FreeBSD pools.  It does change change handling of some pools coming from
> illumos, but previous behavior in that case resulted in kernel panic, so
> anything else is better, while full compatibility is impossible, since
> FreeBSD has no kernel-side AD UID/GID mapping, used by illumos SMB.
>=20
> Could you better describe what ACL mapping breakage you are talking about?=


    Ah... Yeah, it makes sense to leave this alone since it=E2=80=99s a miss=
ing ZFS on FreeBSD feature.
Thank you!
-Enji

PS I was likely messing up my interpretation of the stat field. I didn=E2=80=
=99t read the manpage yet.=

From owner-svn-src-head@freebsd.org  Fri Apr 19 19:45:00 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80B1A1576E2C;
 Fri, 19 Apr 2019 19:45:00 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 21B238EE42;
 Fri, 19 Apr 2019 19:45:00 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE113114;
 Fri, 19 Apr 2019 19:44:59 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JJixtY005180;
 Fri, 19 Apr 2019 19:44:59 GMT (envelope-from imp@FreeBSD.org)
Received: (from imp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JJixAJ005179;
 Fri, 19 Apr 2019 19:44:59 GMT (envelope-from imp@FreeBSD.org)
Message-Id: <201904191944.x3JJixAJ005179@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org
 using -f
From: Warner Losh 
Date: Fri, 19 Apr 2019 19:44:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346407 - head/stand/efi/include
X-SVN-Group: head
X-SVN-Commit-Author: imp
X-SVN-Commit-Paths: head/stand/efi/include
X-SVN-Commit-Revision: 346407
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 21B238EE42
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)[-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, 19 Apr 2019 19:45:00 -0000

Author: imp
Date: Fri Apr 19 19:44:59 2019
New Revision: 346407
URL: https://svnweb.freebsd.org/changeset/base/346407

Log:
  Add define for CONST.
  
  Newer interfaces take CONST parameters, so define CONST to minimize
  differences between our headers and the standards docs.
  
  Differential Revision: https://reviews.freebsd.org/D19971

Modified:
  head/stand/efi/include/efidef.h

Modified: head/stand/efi/include/efidef.h
==============================================================================
--- head/stand/efi/include/efidef.h	Fri Apr 19 18:09:37 2019	(r346406)
+++ head/stand/efi/include/efidef.h	Fri Apr 19 19:44:59 2019	(r346407)
@@ -63,6 +63,7 @@ typedef VOID            *EFI_EVENT;
     #define IN
     #define OUT
     #define OPTIONAL
+    #define CONST const
 #endif
 
 

From owner-svn-src-head@freebsd.org  Fri Apr 19 19:45:16 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 498AF1576E50;
 Fri, 19 Apr 2019 19:45:16 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 E1D148EF8F;
 Fri, 19 Apr 2019 19:45:15 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B80553119;
 Fri, 19 Apr 2019 19:45:15 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JJjFYA005253;
 Fri, 19 Apr 2019 19:45:15 GMT (envelope-from imp@FreeBSD.org)
Received: (from imp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JJjF4g005252;
 Fri, 19 Apr 2019 19:45:15 GMT (envelope-from imp@FreeBSD.org)
Message-Id: <201904191945.x3JJjF4g005252@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org
 using -f
From: Warner Losh 
Date: Fri, 19 Apr 2019 19:45:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346408 - head/stand/efi/include
X-SVN-Group: head
X-SVN-Commit-Author: imp
X-SVN-Commit-Paths: head/stand/efi/include
X-SVN-Commit-Revision: 346408
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: E1D148EF8F
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];
 NEURAL_HAM_LONG(-1.00)[-1.000,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, 19 Apr 2019 19:45:16 -0000

Author: imp
Date: Fri Apr 19 19:45:15 2019
New Revision: 346408
URL: https://svnweb.freebsd.org/changeset/base/346408

Log:
  Add UEFI definitions related to converting string to DEVICE_PATH
  
  Add definitions from UEFI 2.7 Errata B standards doc for converting a
  text string to a device path. Added clearly missing 'e' at the end of
  Device to resolve mismatch in that document in
  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL element names.
  
  Differential Revision: https://reviews.freebsd.org/D19971

Modified:
  head/stand/efi/include/efidevp.h

Modified: head/stand/efi/include/efidevp.h
==============================================================================
--- head/stand/efi/include/efidevp.h	Fri Apr 19 19:44:59 2019	(r346407)
+++ head/stand/efi/include/efidevp.h	Fri Apr 19 19:45:15 2019	(r346408)
@@ -433,6 +433,9 @@ typedef union {
 #define	EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID				\
     { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } }
 
+#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID				\
+    { 0x05c99a21, 0xc70f, 0x4ad2, { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } }
+
 INTERFACE_DECL(_EFI_DEVICE_PATH_PROTOCOL);
 
 typedef
@@ -455,6 +458,23 @@ typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL {
 	EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
 	EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
 } EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
+
+typedef
+struct _EFI_DEVICE_PATH*
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (
+    IN CONST CHAR16* TextDeviceNode
+    );
+typedef
+struct _EFI_DEVICE_PATH*
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) (
+    IN CONST CHAR16* TextDevicePath
+    );
+
+
+typedef struct _EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL {
+	EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertTextToDeviceNode;
+	EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertTextToDevicePath;
+} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
 
 #pragma pack()
 

From owner-svn-src-head@freebsd.org  Fri Apr 19 19:45:21 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B31431576E7E;
 Fri, 19 Apr 2019 19:45:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 4AEE88EFD3;
 Fri, 19 Apr 2019 19:45:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80AF3311A;
 Fri, 19 Apr 2019 19:45:20 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JJjKFt005308;
 Fri, 19 Apr 2019 19:45:20 GMT (envelope-from imp@FreeBSD.org)
Received: (from imp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JJjKuB005307;
 Fri, 19 Apr 2019 19:45:20 GMT (envelope-from imp@FreeBSD.org)
Message-Id: <201904191945.x3JJjKuB005307@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org
 using -f
From: Warner Losh 
Date: Fri, 19 Apr 2019 19:45:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346409 - in head/stand/efi: include libefi
X-SVN-Group: head
X-SVN-Commit-Author: imp
X-SVN-Commit-Paths: in head/stand/efi: include libefi
X-SVN-Commit-Revision: 346409
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 4AEE88EFD3
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)[-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, 19 Apr 2019 19:45:21 -0000

Author: imp
Date: Fri Apr 19 19:45:19 2019
New Revision: 346409
URL: https://svnweb.freebsd.org/changeset/base/346409

Log:
  Add wrapper functions to convert strings to EFI_DEVICE_PATH
  
  In anticipation of new functionality, create routines to convert char *
  and a CHAR16 * to a EFI_DEVICE_PATH
  	EFI_DEVICE_PATH *efi_name_to_devpath(const char *path);
  	EFI_DEVICE_PATH *efi_name_to_devpath16(CHAR16 *path);
  	void efi_devpath_free(EFI_DEVICE_PATH *dp);
  The first two return an EFI_DEVICE_PATH for the passed in paths. The
  third frees up the storage the first two return when the caller is
  done with it.
  
  Differential Revision: https://reviews.freebsd.org/D19971

Modified:
  head/stand/efi/include/efilib.h
  head/stand/efi/libefi/devpath.c

Modified: head/stand/efi/include/efilib.h
==============================================================================
--- head/stand/efi/include/efilib.h	Fri Apr 19 19:45:15 2019	(r346408)
+++ head/stand/efi/include/efilib.h	Fri Apr 19 19:45:19 2019	(r346409)
@@ -92,6 +92,9 @@ CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *);
 void efi_free_devpath_name(CHAR16 *);
 EFI_DEVICE_PATH *efi_devpath_to_media_path(EFI_DEVICE_PATH *);
 UINTN efi_devpath_length(EFI_DEVICE_PATH *);
+EFI_DEVICE_PATH *efi_name_to_devpath(const char *path);
+EFI_DEVICE_PATH *efi_name_to_devpath16(CHAR16 *path);
+void efi_devpath_free(EFI_DEVICE_PATH *dp);
 
 int efi_status_to_errno(EFI_STATUS);
 EFI_STATUS errno_to_efi_status(int errno);

Modified: head/stand/efi/libefi/devpath.c
==============================================================================
--- head/stand/efi/libefi/devpath.c	Fri Apr 19 19:45:15 2019	(r346408)
+++ head/stand/efi/libefi/devpath.c	Fri Apr 19 19:45:19 2019	(r346409)
@@ -28,12 +28,15 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 static EFI_GUID ImageDevicePathGUID =
     EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
 static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
 static EFI_GUID DevicePathToTextGUID = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
-static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *textProtocol;
+static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *toTextProtocol;
+static EFI_GUID DevicePathFromTextGUID = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
+static EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *fromTextProtocol;
 
 EFI_DEVICE_PATH *
 efi_lookup_image_devpath(EFI_HANDLE handle)
@@ -63,22 +66,20 @@ efi_lookup_devpath(EFI_HANDLE handle)
 CHAR16 *
 efi_devpath_name(EFI_DEVICE_PATH *devpath)
 {
-	static int once = 1;
 	EFI_STATUS status;
 
 	if (devpath == NULL)
 		return (NULL);
-	if (once) {
+	if (toTextProtocol == NULL) {
 		status = BS->LocateProtocol(&DevicePathToTextGUID, NULL,
-		    (VOID **)&textProtocol);
+		    (VOID **)&toTextProtocol);
 		if (EFI_ERROR(status))
-			textProtocol = NULL;
-		once = 0;
+			toTextProtocol = NULL;
 	}
-	if (textProtocol == NULL)
+	if (toTextProtocol == NULL)
 		return (NULL);
 
-	return (textProtocol->ConvertDevicePathToText(devpath, TRUE, TRUE));
+	return (toTextProtocol->ConvertDevicePathToText(devpath, TRUE, TRUE));
 }
 
 void
@@ -86,6 +87,46 @@ efi_free_devpath_name(CHAR16 *text)
 {
 
 	BS->FreePool(text);
+}
+
+EFI_DEVICE_PATH *
+efi_name_to_devpath(const char *path)
+{
+	EFI_DEVICE_PATH *devpath;
+	CHAR16 *uv;
+	size_t ul;
+
+	uv = NULL;
+	if (utf8_to_ucs2(path, &uv, &ul) != 0)
+		return (NULL);
+	devpath = efi_name_to_devpath16(uv);
+	free(uv);
+	return (devpath);
+}
+
+EFI_DEVICE_PATH *
+efi_name_to_devpath16(CHAR16 *path)
+{
+	EFI_STATUS status;
+
+	if (path == NULL)
+		return (NULL);
+	if (fromTextProtocol == NULL) {
+		status = BS->LocateProtocol(&DevicePathFromTextGUID, NULL,
+		    (VOID **)&fromTextProtocol);
+		if (EFI_ERROR(status))
+			fromTextProtocol = NULL;
+	}
+	if (fromTextProtocol == NULL)
+		return (NULL);
+
+	return (fromTextProtocol->ConvertTextToDevicePath(path));
+}
+
+void efi_devpath_free(EFI_DEVICE_PATH *devpath)
+{
+
+	BS->FreePool(devpath);
 }
 
 EFI_DEVICE_PATH *

From owner-svn-src-head@freebsd.org  Fri Apr 19 20:05:50 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C48157762E;
 Fri, 19 Apr 2019 20:05:49 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.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 85D068FD2D;
 Fri, 19 Apr 2019 20:05:49 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73E093490;
 Fri, 19 Apr 2019 20:05:49 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JK5nmY015807;
 Fri, 19 Apr 2019 20:05:49 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JK5mhm015801;
 Fri, 19 Apr 2019 20:05:48 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201904192005.x3JK5mhm015801@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Fri, 19 Apr 2019 20:05:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346410 - in head: lib/libc/gen share/man/man9 sys/conf
 sys/libkern sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: in head: lib/libc/gen share/man/man9 sys/conf sys/libkern
 sys/sys
X-SVN-Commit-Revision: 346410
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 85D068FD2D
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.96)[-0.962,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, 19 Apr 2019 20:05:50 -0000

Author: cem
Date: Fri Apr 19 20:05:47 2019
New Revision: 346410
URL: https://svnweb.freebsd.org/changeset/base/346410

Log:
  libkern: Bring in arc4random_uniform(9) from libc
  
  It is a useful arc4random wrapper in the kernel for much the same reasons as
  in userspace.  Move the source to libkern (because kernel build is
  restricted to sys/, but userspace can include any file it likes) and build
  kernel and libc versions from the same source file.
  
  Copy the documentation from arc4random_uniform(3) to the section 9 page.
  
  While here, add missing arc4random_buf(9) symlink.
  
  Sponsored by:	Dell EMC Isilon

Added:
  head/sys/libkern/arc4random_uniform.c
     - copied, changed from r346409, head/lib/libc/gen/arc4random_uniform.c
Deleted:
  head/lib/libc/gen/arc4random_uniform.c
Modified:
  head/lib/libc/gen/Makefile.inc
  head/share/man/man9/Makefile
  head/share/man/man9/random.9
  head/sys/conf/files
  head/sys/sys/libkern.h

Modified: head/lib/libc/gen/Makefile.inc
==============================================================================
--- head/lib/libc/gen/Makefile.inc	Fri Apr 19 19:45:19 2019	(r346409)
+++ head/lib/libc/gen/Makefile.inc	Fri Apr 19 20:05:47 2019	(r346410)
@@ -3,6 +3,7 @@
 
 # machine-independent gen sources
 .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
+.PATH: ${SRCTOP}/sys/libkern
 
 CONFS=	shells
 

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Fri Apr 19 19:45:19 2019	(r346409)
+++ head/share/man/man9/Makefile	Fri Apr 19 20:05:47 2019	(r346410)
@@ -1668,6 +1668,8 @@ MLINKS+=psignal.9 gsignal.9 \
 	psignal.9 tdsignal.9
 MLINKS+=random.9 arc4rand.9 \
 	random.9 arc4random.9 \
+	random.9 arc4random_buf.9 \
+	random.9 arc4random_uniform.9 \
 	random.9 is_random_seeded.9 \
 	random.9 read_random.9 \
 	random.9 read_random_uio.9 \

Modified: head/share/man/man9/random.9
==============================================================================
--- head/share/man/man9/random.9	Fri Apr 19 19:45:19 2019	(r346409)
+++ head/share/man/man9/random.9	Fri Apr 19 20:05:47 2019	(r346410)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\" "
-.Dd April 16, 2019
+.Dd April 19, 2019
 .Dt RANDOM 9
 .Os
 .Sh NAME
@@ -45,6 +45,8 @@
 .Fn arc4random "void"
 .Ft void
 .Fn arc4random_buf "void *ptr" "size_t len"
+.Ft uint32_t
+.Fn arc4random_uniform "uint32_t upper_bound"
 .Ft void
 .Fn arc4rand "void *ptr" "u_int length" "int reseed"
 .Pp
@@ -79,6 +81,15 @@ fills
 with
 .Fa len
 bytes of random data.
+.Pp
+.Fn arc4random_uniform
+will return a single 32-bit value, uniformly distributed but less than
+.Fa upper_bound .
+This is recommended over constructions like
+.Dq Li arc4random() % upper_bound
+as it avoids "modulo bias" when the upper bound is not a power of two.
+In the worst case, this function may consume multiple iterations
+to ensure uniformity.
 .Pp
 The
 .Fn arc4rand

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Apr 19 19:45:19 2019	(r346409)
+++ head/sys/conf/files	Fri Apr 19 20:05:47 2019	(r346410)
@@ -3985,6 +3985,7 @@ kgssapi/gsstest.c		optional kgssapi_debug
 # the file should be moved to conf/files. from here.
 #
 libkern/arc4random.c		standard
+libkern/arc4random_uniform.c	standard
 crypto/chacha20/chacha.c	standard
 libkern/asprintf.c		standard
 libkern/bcd.c			standard

Copied and modified: head/sys/libkern/arc4random_uniform.c (from r346409, head/lib/libc/gen/arc4random_uniform.c)
==============================================================================
--- head/lib/libc/gen/arc4random_uniform.c	Fri Apr 19 19:45:19 2019	(r346409, copy source)
+++ head/sys/libkern/arc4random_uniform.c	Fri Apr 19 20:05:47 2019	(r346410)
@@ -19,7 +19,11 @@
  */
 
 #include 
+#ifdef _KERNEL
+#include 
+#else
 #include 
+#endif
 
 /*
  * Calculate a uniformly distributed random number less than upper_bound

Modified: head/sys/sys/libkern.h
==============================================================================
--- head/sys/sys/libkern.h	Fri Apr 19 19:45:19 2019	(r346409)
+++ head/sys/sys/libkern.h	Fri Apr 19 20:05:47 2019	(r346410)
@@ -128,6 +128,7 @@ struct malloc_type;
 uint32_t arc4random(void);
 void	 arc4random_buf(void *, size_t);
 void	 arc4rand(void *, u_int, int);
+uint32_t arc4random_uniform(uint32_t);
 int	 timingsafe_bcmp(const void *, const void *, size_t);
 void	*bsearch(const void *, const void *, size_t,
 	    size_t, int (*)(const void *, const void *));

From owner-svn-src-head@freebsd.org  Fri Apr 19 20:06:23 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34969157768D;
 Fri, 19 Apr 2019 20:06:23 +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 C7ACF8FE67;
 Fri, 19 Apr 2019 20:06:22 +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 A0B243491;
 Fri, 19 Apr 2019 20:06:22 +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 x3JK6M4k015871;
 Fri, 19 Apr 2019 20:06:22 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JK6MNf015870;
 Fri, 19 Apr 2019 20:06:22 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201904192006.x3JK6MNf015870@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Fri, 19 Apr 2019 20:06:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346411 - head/sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/sys/sys
X-SVN-Commit-Revision: 346411
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: C7ACF8FE67
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)[-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, 19 Apr 2019 20:06:23 -0000

Author: cem
Date: Fri Apr 19 20:06:22 2019
New Revision: 346411
URL: https://svnweb.freebsd.org/changeset/base/346411

Log:
  Bump __FreeBSD_version after r346410

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Fri Apr 19 20:05:47 2019	(r346410)
+++ head/sys/sys/param.h	Fri Apr 19 20:06:22 2019	(r346411)
@@ -60,7 +60,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300020	/* Master, propagated to newvers */
+#define __FreeBSD_version 1300021	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-head@freebsd.org  Fri Apr 19 20:08:46 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72E2D1577748;
 Fri, 19 Apr 2019 20:08:46 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.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 14A0A68005;
 Fri, 19 Apr 2019 20:08:46 +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 05FC43494;
 Fri, 19 Apr 2019 20:08:46 +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 x3JK8jnL016015;
 Fri, 19 Apr 2019 20:08:45 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JK8jbD016014;
 Fri, 19 Apr 2019 20:08:45 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201904192008.x3JK8jbD016014@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Fri, 19 Apr 2019 20:08:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346412 - head/sys/conf
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/sys/conf
X-SVN-Commit-Revision: 346412
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 14A0A68005
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];
 NEURAL_HAM_LONG(-1.00)[-1.000,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, 19 Apr 2019 20:08:46 -0000

Author: cem
Date: Fri Apr 19 20:08:45 2019
New Revision: 346412
URL: https://svnweb.freebsd.org/changeset/base/346412

Log:
  kernel build: Disable unhelpful GCC warning (tripped after r346352)
  
  -Wformat-zero-length does not highlight any particularly wrong code and it
  is especially meaningless for device_printf().  Turn it off entirely to
  remove a source of false positives.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==============================================================================
--- head/sys/conf/kern.mk	Fri Apr 19 20:06:22 2019	(r346411)
+++ head/sys/conf/kern.mk	Fri Apr 19 20:08:45 2019	(r346412)
@@ -61,7 +61,8 @@ CWARNEXTRA?=	-Wno-error=address				\
 CWARNEXTRA+=	-Wno-error=misleading-indentation		\
 		-Wno-error=nonnull-compare			\
 		-Wno-error=shift-overflow			\
-		-Wno-error=tautological-compare
+		-Wno-error=tautological-compare			\
+		-Wno-format-zero-length
 .endif
 .if ${COMPILER_VERSION} >= 70200
 CWARNEXTRA+=	-Wno-error=memset-elt-size

From owner-svn-src-head@freebsd.org  Fri Apr 19 20:29:50 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 425141578037;
 Fri, 19 Apr 2019 20:29:50 +0000 (UTC) (envelope-from bde@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 DA9086A563;
 Fri, 19 Apr 2019 20:29:49 +0000 (UTC) (envelope-from bde@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0FE839BA;
 Fri, 19 Apr 2019 20:29:49 +0000 (UTC) (envelope-from bde@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JKTnV2026913;
 Fri, 19 Apr 2019 20:29:49 GMT (envelope-from bde@FreeBSD.org)
Received: (from bde@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JKTn8R026912;
 Fri, 19 Apr 2019 20:29:49 GMT (envelope-from bde@FreeBSD.org)
Message-Id: <201904192029.x3JKTn8R026912@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org
 using -f
From: Bruce Evans 
Date: Fri, 19 Apr 2019 20:29:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346416 - head/lib/libvgl
X-SVN-Group: head
X-SVN-Commit-Author: bde
X-SVN-Commit-Paths: head/lib/libvgl
X-SVN-Commit-Revision: 346416
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: DA9086A563
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)[-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, 19 Apr 2019 20:29:50 -0000

Author: bde
Date: Fri Apr 19 20:29:49 2019
New Revision: 346416
URL: https://svnweb.freebsd.org/changeset/base/346416

Log:
  Fix copying of overlapping bitmaps.  The cases of copying within the
  screen bitmap and within a single MEMBUF were broken when first source
  line is before the first destination line and the sub-bitmaps overlap.
  
  The fix just copies horizontal lines in reverse order when the first
  source line is before the first destination line.  This switches
  directions unnecessarily in some cases, but the switch is about as
  fast as doing a precise detection of overlaps.  When the first lines
  are the same, there can be undetected overlap in the horizontal
  direction.  The old code already handles this mostly accidentally by
  using bcopy() for MEMBUFs and by copying through a temporary buffer
  for the screen bitmap although the latter is sub-optimal in direct
  modes.

Modified:
  head/lib/libvgl/bitmap.c

Modified: head/lib/libvgl/bitmap.c
==============================================================================
--- head/lib/libvgl/bitmap.c	Fri Apr 19 20:23:39 2019	(r346415)
+++ head/lib/libvgl/bitmap.c	Fri Apr 19 20:29:49 2019	(r346416)
@@ -269,7 +269,7 @@ int
 __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
 	      VGLBitmap *dst, int dstx, int dsty, int width, int hight)
 {
-  int srcline, dstline;
+  int srcline, dstline, yend, yextra, ystep;
 
   if (srcx>src->VXsize || srcy>src->VYsize
 	|| dstx>dst->VXsize || dsty>dst->VYsize)
@@ -296,8 +296,17 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
      hight=dst->VYsize-dsty;
   if (width < 0 || hight < 0)
      return -1;
+  yend = srcy + hight;
+  yextra = 0;
+  ystep = 1;
+  if (src->Bitmap == dst->Bitmap && srcy < dsty) {
+    yend = srcy;
+    yextra = hight - 1;
+    ystep = -1;
+  }
   if (src->Type == MEMBUF) {
-    for (srcline=srcy, dstline=dsty; srclineBitmap+(srcline*src->VXsize+srcx)*dst->PixelBytes);
     }
@@ -319,7 +328,8 @@ __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
     } else {
       p = buffer;
     }
-    for (srcline=srcy, dstline=dsty; srcline
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34F171578DEC;
 Fri, 19 Apr 2019 21:05:00 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.18])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 981546B99C;
 Fri, 19 Apr 2019 21:04:59 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1555707891;
 bh=sOoCgq4cAk+QTtkqk8mwqA8Aneoif721FeS3Sy0J1MM=;
 h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References;
 b=laf68ydrIesRPRfO/BRlNBpJ/BPW3TSP9iDyIfHlN7dlGiRNsDkM9YgvKGA3sSh3i
 9Yv2hdBPmbmj9KbiMD52n8TY4yM6A6Zwadm4kwwctmrHo5J4DMno/6BryyxfREyeHG
 lNecC8Df1J2v/N8wFJeOG32259bMomWyC+rSMZV0=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from thor.intern.walstatt.dynvpn.de ([77.13.145.114]) by
 mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id
 0MbgKD-1had3u2hNN-00Izcd; Fri, 19 Apr 2019 22:59:39 +0200
Date: Fri, 19 Apr 2019 22:59:04 +0200
From: "O. Hartmann" 
To: Conrad Meyer 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r346410 - in head: lib/libc/gen share/man/man9
 sys/conf sys/libkern sys/sys
Message-ID: <20190419225931.1311745d@thor.intern.walstatt.dynvpn.de>
In-Reply-To: <201904192005.x3JK5mhm015801@repo.freebsd.org>
References: <201904192005.x3JK5mhm015801@repo.freebsd.org>
Organization: WALSTATT
User-Agent: OutScare 3.1415926
X-Operating-System: ImNotAnOperatingSystem 3.141592527
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64
X-Provags-ID: V03:K1:/5BPKC2jCC9/Ud/P8wD77VTyeLhqlYjJLiHEqfjOyb7xK2yb6Ql
 SizUxi2B0L8/3jOQOzUbGi8E3jREoRos+6KsUTTwlE2I4S6wqUFtA+W8X2tlRvFZGnVpiMk
 Tc5YpWq/OR8vFx2vl0EixI8VcsxTS+y54JJFTmL2QyOX/u7KTsGmh36HRgJHV24HpYDg4AM
 +HswBpBzVEzcH08muZygQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:9rWY2u0C+3Q=:LGzGi4URDxe4nTDwH4mWGL
 JRBhtCdoYk/+/j8AEYEIsSn2sMvdJxkD7VhBgcuHNOPkDpe0WbMj+yHAj50LrosNEtqP59KZC
 IV2ePOGHQNCC2OrzHiBRx1BD7U9ju68/p2WV1WuL58671Dwq9LnSjsgXd381l8zbgvaUyPDGG
 ci868/lkztF3Yz/++7Vc4aAdFBdn8+APZKDIMZnwCo+uU9nh+aeGZw41hHQ0esJj1kyXfHsbZ
 8UsDYregW/QnhJukvJI3cq1LMoFLW3IMxEkisl8j7zFZbExOGwMuvprqpxiwxAF3FTk9Di5+I
 RLWTVRODzTqdmJO6CW7rts1V9Wc86nV9TOG8bknCBKdAy/+2Xjqnab7tk2Ahz6VPdkAxqwUlQ
 7saQRHKufN/voUraH8I9hyQzqEFM5SIvQvxbkAA3lHl4nu7fo+ymbJc3cPp/wMbxhOrexIzUu
 K6zrCb3Bkjrt5CP30nf16RDCuEXI4RhOqqZ3J8Dh+bVx07dR2LpJtdMTMiP3igdVAhuRz/gbJ
 pE9Jd8kS07jUq13zX/lLckg581O2EYrKqsevfHTIqqiD0dYYufZgubmibR1vtzo+GvUFfbdMz
 nxT3hCrQeq0k952M+nvOhgW0fGXLha2D4N/PMRfY3gLihSm8deonvIuOn1t1AHYy6J2CisH7v
 DNTiZBbROtqtWVY7WaQ0AZw2n1AjoG6VclTrixYlSmWlQXVoYdW041odZvRqoQVwYJFKcr1n8
 /b4jVWYKHmawwMpKQbGt8zHt0ALOPm8Ipuq8qF0sfM37PXph1va4i8YiT6m0m6Nzh3GoxSxpP
 4k52NoKTh7de5z1blf5dlcB1VYyCnmiwbSzTeg+qvW98mR6DQ0A8xnbfTiLkccDy1G3Opo24i
 BJxXieSIPVUyW26D0as8z6e+s0zRUDPgNZZN4V+A1LRUeiKP2NnUk6LyemrtDOl1+Vxk9IU7l
 o4YUVuJyv5A==
X-Rspamd-Queue-Id: 981546B99C
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.94 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.94)[-0.942,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, 19 Apr 2019 21:05:00 -0000

LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIEZy
aSwgMTkgQXByIDIwMTkgMjA6MDU6NDggKzAwMDAgKFVUQykNCkNvbnJhZCBNZXllciA8Y2VtQEZy
ZWVCU0Qub3JnPiBzY2hyaWViOg0KDQo+IEF1dGhvcjogY2VtDQo+IERhdGU6IEZyaSBBcHIgMTkg
MjA6MDU6NDcgMjAxOQ0KPiBOZXcgUmV2aXNpb246IDM0NjQxMA0KPiBVUkw6IGh0dHBzOi8vc3Zu
d2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzM0NjQxMA0KPiANCj4gTG9nOg0KPiAgIGxp
Ymtlcm46IEJyaW5nIGluIGFyYzRyYW5kb21fdW5pZm9ybSg5KSBmcm9tIGxpYmMNCj4gICANCj4g
ICBJdCBpcyBhIHVzZWZ1bCBhcmM0cmFuZG9tIHdyYXBwZXIgaW4gdGhlIGtlcm5lbCBmb3IgbXVj
aCB0aGUgc2FtZSByZWFzb25zIGFzDQo+ICAgaW4gdXNlcnNwYWNlLiAgTW92ZSB0aGUgc291cmNl
IHRvIGxpYmtlcm4gKGJlY2F1c2Uga2VybmVsIGJ1aWxkIGlzDQo+ICAgcmVzdHJpY3RlZCB0byBz
eXMvLCBidXQgdXNlcnNwYWNlIGNhbiBpbmNsdWRlIGFueSBmaWxlIGl0IGxpa2VzKSBhbmQgYnVp
bGQNCj4gICBrZXJuZWwgYW5kIGxpYmMgdmVyc2lvbnMgZnJvbSB0aGUgc2FtZSBzb3VyY2UgZmls
ZS4NCj4gICANCj4gICBDb3B5IHRoZSBkb2N1bWVudGF0aW9uIGZyb20gYXJjNHJhbmRvbV91bmlm
b3JtKDMpIHRvIHRoZSBzZWN0aW9uIDkgcGFnZS4NCj4gICANCj4gICBXaGlsZSBoZXJlLCBhZGQg
bWlzc2luZyBhcmM0cmFuZG9tX2J1Zig5KSBzeW1saW5rLg0KPiAgIA0KPiAgIFNwb25zb3JlZCBi
eToJRGVsbCBFTUMgSXNpbG9uDQo+IA0KPiBBZGRlZDoNCj4gICBoZWFkL3N5cy9saWJrZXJuL2Fy
YzRyYW5kb21fdW5pZm9ybS5jDQo+ICAgICAgLSBjb3BpZWQsIGNoYW5nZWQgZnJvbSByMzQ2NDA5
LCBoZWFkL2xpYi9saWJjL2dlbi9hcmM0cmFuZG9tX3VuaWZvcm0uYw0KPiBEZWxldGVkOg0KPiAg
IGhlYWQvbGliL2xpYmMvZ2VuL2FyYzRyYW5kb21fdW5pZm9ybS5jDQo+IE1vZGlmaWVkOg0KPiAg
IGhlYWQvbGliL2xpYmMvZ2VuL01ha2VmaWxlLmluYw0KPiAgIGhlYWQvc2hhcmUvbWFuL21hbjkv
TWFrZWZpbGUNCj4gICBoZWFkL3NoYXJlL21hbi9tYW45L3JhbmRvbS45DQo+ICAgaGVhZC9zeXMv
Y29uZi9maWxlcw0KPiAgIGhlYWQvc3lzL3N5cy9saWJrZXJuLmgNCj4gDQo+IE1vZGlmaWVkOiBo
ZWFkL2xpYi9saWJjL2dlbi9NYWtlZmlsZS5pbmMNCj4gPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+
IC0tLSBoZWFkL2xpYi9saWJjL2dlbi9NYWtlZmlsZS5pbmMJRnJpIEFwciAxOSAxOTo0NToxOSAy
MDE5CShyMzQ2NDA5KQ0KPiArKysgaGVhZC9saWIvbGliYy9nZW4vTWFrZWZpbGUuaW5jCUZyaSBB
cHIgMTkgMjA6MDU6NDcgMjAxOQkocjM0NjQxMCkNCj4gQEAgLTMsNiArMyw3IEBADQo+ICANCj4g
ICMgbWFjaGluZS1pbmRlcGVuZGVudCBnZW4gc291cmNlcw0KPiAgLlBBVEg6ICR7TElCQ19TUkNU
T1B9LyR7TElCQ19BUkNIfS9nZW4gJHtMSUJDX1NSQ1RPUH0vZ2VuDQo+ICsuUEFUSDogJHtTUkNU
T1B9L3N5cy9saWJrZXJuDQo+ICANCj4gIENPTkZTPQlzaGVsbHMNCj4gIA0KPiANCj4gTW9kaWZp
ZWQ6IGhlYWQvc2hhcmUvbWFuL21hbjkvTWFrZWZpbGUNCj4gPT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
DQo+IC0tLSBoZWFkL3NoYXJlL21hbi9tYW45L01ha2VmaWxlCUZyaSBBcHIgMTkgMTk6NDU6MTkg
MjAxOQkocjM0NjQwOSkNCj4gKysrIGhlYWQvc2hhcmUvbWFuL21hbjkvTWFrZWZpbGUJRnJpIEFw
ciAxOSAyMDowNTo0NyAyMDE5CShyMzQ2NDEwKQ0KPiBAQCAtMTY2OCw2ICsxNjY4LDggQEAgTUxJ
TktTKz1wc2lnbmFsLjkgZ3NpZ25hbC45IFwNCj4gIAlwc2lnbmFsLjkgdGRzaWduYWwuOQ0KPiAg
TUxJTktTKz1yYW5kb20uOSBhcmM0cmFuZC45IFwNCj4gIAlyYW5kb20uOSBhcmM0cmFuZG9tLjkg
XA0KPiArCXJhbmRvbS45IGFyYzRyYW5kb21fYnVmLjkgXA0KPiArCXJhbmRvbS45IGFyYzRyYW5k
b21fdW5pZm9ybS45IFwNCj4gIAlyYW5kb20uOSBpc19yYW5kb21fc2VlZGVkLjkgXA0KPiAgCXJh
bmRvbS45IHJlYWRfcmFuZG9tLjkgXA0KPiAgCXJhbmRvbS45IHJlYWRfcmFuZG9tX3Vpby45IFwN
Cj4gDQo+IE1vZGlmaWVkOiBoZWFkL3NoYXJlL21hbi9tYW45L3JhbmRvbS45DQo+ID09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zaGFyZS9tYW4vbWFuOS9yYW5kb20uOQlGcmkgQXBy
IDE5IDE5OjQ1OjE5IDIwMTkJKHIzNDY0MDkpDQo+ICsrKyBoZWFkL3NoYXJlL21hbi9tYW45L3Jh
bmRvbS45CUZyaSBBcHIgMTkgMjA6MDU6NDcgMjAxOQkocjM0NjQxMCkNCj4gQEAgLTI2LDcgKzI2
LDcgQEANCj4gIC5cIg0KPiAgLlwiICRGcmVlQlNEJA0KPiAgLlwiICINCj4gLS5EZCBBcHJpbCAx
NiwgMjAxOQ0KPiArLkRkIEFwcmlsIDE5LCAyMDE5DQo+ICAuRHQgUkFORE9NIDkNCj4gIC5Pcw0K
PiAgLlNoIE5BTUUNCj4gQEAgLTQ1LDYgKzQ1LDggQEANCj4gIC5GbiBhcmM0cmFuZG9tICJ2b2lk
Ig0KPiAgLkZ0IHZvaWQNCj4gIC5GbiBhcmM0cmFuZG9tX2J1ZiAidm9pZCAqcHRyIiAic2l6ZV90
IGxlbiINCj4gKy5GdCB1aW50MzJfdA0KPiArLkZuIGFyYzRyYW5kb21fdW5pZm9ybSAidWludDMy
X3QgdXBwZXJfYm91bmQiDQo+ICAuRnQgdm9pZA0KPiAgLkZuIGFyYzRyYW5kICJ2b2lkICpwdHIi
ICJ1X2ludCBsZW5ndGgiICJpbnQgcmVzZWVkIg0KPiAgLlBwDQo+IEBAIC03OSw2ICs4MSwxNSBA
QCBmaWxscw0KPiAgd2l0aA0KPiAgLkZhIGxlbg0KPiAgYnl0ZXMgb2YgcmFuZG9tIGRhdGEuDQo+
ICsuUHANCj4gKy5GbiBhcmM0cmFuZG9tX3VuaWZvcm0NCj4gK3dpbGwgcmV0dXJuIGEgc2luZ2xl
IDMyLWJpdCB2YWx1ZSwgdW5pZm9ybWx5IGRpc3RyaWJ1dGVkIGJ1dCBsZXNzIHRoYW4NCj4gKy5G
YSB1cHBlcl9ib3VuZCAuDQo+ICtUaGlzIGlzIHJlY29tbWVuZGVkIG92ZXIgY29uc3RydWN0aW9u
cyBsaWtlDQo+ICsuRHEgTGkgYXJjNHJhbmRvbSgpICUgdXBwZXJfYm91bmQNCj4gK2FzIGl0IGF2
b2lkcyAibW9kdWxvIGJpYXMiIHdoZW4gdGhlIHVwcGVyIGJvdW5kIGlzIG5vdCBhIHBvd2VyIG9m
IHR3by4NCj4gK0luIHRoZSB3b3JzdCBjYXNlLCB0aGlzIGZ1bmN0aW9uIG1heSBjb25zdW1lIG11
bHRpcGxlIGl0ZXJhdGlvbnMNCj4gK3RvIGVuc3VyZSB1bmlmb3JtaXR5Lg0KPiAgLlBwDQo+ICBU
aGUNCj4gIC5GbiBhcmM0cmFuZA0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvc3lzL2NvbmYvZmlsZXMN
Cj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9jb25mL2ZpbGVzCUZyaSBB
cHIgMTkgMTk6NDU6MTkgMjAxOQkocjM0NjQwOSkNCj4gKysrIGhlYWQvc3lzL2NvbmYvZmlsZXMJ
RnJpIEFwciAxOSAyMDowNTo0NyAyMDE5CShyMzQ2NDEwKQ0KPiBAQCAtMzk4NSw2ICszOTg1LDcg
QEAga2dzc2FwaS9nc3N0ZXN0LmMJCW9wdGlvbmFsIGtnc3NhcGlfZGVidWcNCj4gICMgdGhlIGZp
bGUgc2hvdWxkIGJlIG1vdmVkIHRvIGNvbmYvZmlsZXMuPGFyY2g+IGZyb20gaGVyZS4NCj4gICMN
Cj4gIGxpYmtlcm4vYXJjNHJhbmRvbS5jCQlzdGFuZGFyZA0KPiArbGlia2Vybi9hcmM0cmFuZG9t
X3VuaWZvcm0uYwlzdGFuZGFyZA0KPiAgY3J5cHRvL2NoYWNoYTIwL2NoYWNoYS5jCXN0YW5kYXJk
DQo+ICBsaWJrZXJuL2FzcHJpbnRmLmMJCXN0YW5kYXJkDQo+ICBsaWJrZXJuL2JjZC5jCQkJc3Rh
bmRhcmQNCj4gDQo+IENvcGllZCBhbmQgbW9kaWZpZWQ6IGhlYWQvc3lzL2xpYmtlcm4vYXJjNHJh
bmRvbV91bmlmb3JtLmMgKGZyb20gcjM0NjQwOSwNCj4gaGVhZC9saWIvbGliYy9nZW4vYXJjNHJh
bmRvbV91bmlmb3JtLmMpDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAtLS0NCj4gaGVhZC9saWIv
bGliYy9nZW4vYXJjNHJhbmRvbV91bmlmb3JtLmMJRnJpIEFwciAxOSAxOTo0NToxOSAyMDE5CShy
MzQ2NDA5LCBjb3B5DQo+IHNvdXJjZSkgKysrIGhlYWQvc3lzL2xpYmtlcm4vYXJjNHJhbmRvbV91
bmlmb3JtLmMJRnJpIEFwciAxOSAyMDowNTo0NyAyMDE5DQo+IChyMzQ2NDEwKSBAQCAtMTksNyAr
MTksMTEgQEAgKi8NCj4gIA0KPiAgI2luY2x1ZGUgPHN5cy90eXBlcy5oPg0KPiArI2lmZGVmIF9L
RVJORUwNCj4gKyNpbmNsdWRlIDxzeXMvbGlia2Vybi5oPg0KPiArI2Vsc2UNCj4gICNpbmNsdWRl
IDxzdGRsaWIuaD4NCj4gKyNlbmRpZg0KPiAgDQo+ICAvKg0KPiAgICogQ2FsY3VsYXRlIGEgdW5p
Zm9ybWx5IGRpc3RyaWJ1dGVkIHJhbmRvbSBudW1iZXIgbGVzcyB0aGFuIHVwcGVyX2JvdW5kDQo+
IA0KPiBNb2RpZmllZDogaGVhZC9zeXMvc3lzL2xpYmtlcm4uaA0KPiA9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0NCj4gLS0tIGhlYWQvc3lzL3N5cy9saWJrZXJuLmgJRnJpIEFwciAxOSAxOTo0NToxOSAy
MDE5CShyMzQ2NDA5KQ0KPiArKysgaGVhZC9zeXMvc3lzL2xpYmtlcm4uaAlGcmkgQXByIDE5IDIw
OjA1OjQ3IDIwMTkJKHIzNDY0MTApDQo+IEBAIC0xMjgsNiArMTI4LDcgQEAgc3RydWN0IG1hbGxv
Y190eXBlOw0KPiAgdWludDMyX3QgYXJjNHJhbmRvbSh2b2lkKTsNCj4gIHZvaWQJIGFyYzRyYW5k
b21fYnVmKHZvaWQgKiwgc2l6ZV90KTsNCj4gIHZvaWQJIGFyYzRyYW5kKHZvaWQgKiwgdV9pbnQs
IGludCk7DQo+ICt1aW50MzJfdCBhcmM0cmFuZG9tX3VuaWZvcm0odWludDMyX3QpOw0KPiAgaW50
CSB0aW1pbmdzYWZlX2JjbXAoY29uc3Qgdm9pZCAqLCBjb25zdCB2b2lkICosIHNpemVfdCk7DQo+
ICB2b2lkCSpic2VhcmNoKGNvbnN0IHZvaWQgKiwgY29uc3Qgdm9pZCAqLCBzaXplX3QsDQo+ICAJ
ICAgIHNpemVfdCwgaW50ICgqKShjb25zdCB2b2lkICosIGNvbnN0IHZvaWQgKikpOw0KPiBfX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KPiBzdm4tc3JjLWhl
YWRAZnJlZWJzZC5vcmcgbWFpbGluZyBsaXN0DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5vcmcv
bWFpbG1hbi9saXN0aW5mby9zdm4tc3JjLWhlYWQNCj4gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYW55
IG1haWwgdG8gInN2bi1zcmMtaGVhZC11bnN1YnNjcmliZUBmcmVlYnNkLm9yZyINCg0KQWZ0ZXIg
YXBwbHlpbmcgcjM0NjQxMCB0byBvdXIgc291cmNlIHRyZWUsIGJ1aWxkd29ybGQgZmFpbHMgKFdJ
VEhfTUVUQV9NT0RFIGlzIHNldCk6DQoNClsuLi5dDQpCdWlsZGluZyAvdXNyL29iai91c3Ivc3Jj
L2FtZDY0LmFtZDY0L2xpYi9saWJjL2V2X3RpbWVycy5vDQotIC0tLSBpbmV0X250b2EubyAtLS0N
CkluIGZpbGUgaW5jbHVkZWQgZnJvbSAvdXNyL3NyYy9zeXMvbGlia2Vybi9pbmV0X250b2EuYzoz
NDoNCi91c3Ivb2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQvdG1wL3Vzci9pbmNsdWRlL3N5cy9zeXN0
bS5oOjE3Mjo4OiBlcnJvcjogdW5rbm93biB0eXBlIG5hbWUgJ2Jvb2wnDQpleHRlcm4gYm9vbCBk
eW5hbWljX2tlbnY7DQogICAgICAgXg0KL3Vzci9vYmovdXNyL3NyYy9hbWQ2NC5hbWQ2NC90bXAv
dXNyL2luY2x1ZGUvc3lzL3N5c3RtLmg6MjExOjU6IHdhcm5pbmc6IGRlY2xhcmF0aW9uIG9mDQpi
dWlsdC1pbiBmdW5jdGlvbiAnc2V0am1wJyByZXF1aXJlcyBpbmNsdXNpb24gb2YgdGhlIGhlYWRl
ciA8c2V0am1wLmg+DQpbLVdidWlsdGluLXJlcXVpcmVzLWhlYWRlcl0gaW50ICAgICBzZXRqbXAo
c3RydWN0IF9qbXBfYnVmICopIF9fcmV0dXJuc190d2ljZTsgXg0KL3Vzci9vYmovdXNyL3NyYy9h
bWQ2NC5hbWQ2NC90bXAvdXNyL2luY2x1ZGUvc3lzL3N5c3RtLmg6MjEyOjY6IHdhcm5pbmc6IGRl
Y2xhcmF0aW9uIG9mDQpidWlsdC1pbiBmdW5jdGlvbiAnbG9uZ2ptcCcgcmVxdWlyZXMgaW5jbHVz
aW9uIG9mIHRoZSBoZWFkZXIgPHNldGptcC5oPg0KWy1XYnVpbHRpbi1yZXF1aXJlcy1oZWFkZXJd
IHZvaWQgICAgbG9uZ2ptcChzdHJ1Y3QgX2ptcF9idWYgKiwgaW50KSBfX2RlYWQyOyBeDQovdXNy
L29iai91c3Ivc3JjL2FtZDY0LmFtZDY0L3RtcC91c3IvaW5jbHVkZS9zeXMvc3lzdG0uaDoyODU6
Njogd2FybmluZzogaW5jb21wYXRpYmxlDQpyZWRlY2xhcmF0aW9uIG9mIGxpYnJhcnkgZnVuY3Rp
b24gJ2xvZycgWy1XaW5jb21wYXRpYmxlLWxpYnJhcnktcmVkZWNsYXJhdGlvbl0gdm9pZA0KbG9n
KGludCwgY29uc3QgY2hhciAqLCAuLi4pIF9fcHJpbnRmbGlrZSgyLCAzKTsgXg0KL3Vzci9vYmov
dXNyL3NyYy9hbWQ2NC5hbWQ2NC90bXAvdXNyL2luY2x1ZGUvc3lzL3N5c3RtLmg6Mjg1OjY6IG5v
dGU6ICdsb2cnIGlzIGEgYnVpbHRpbiB3aXRoDQp0eXBlICdkb3VibGUgKGRvdWJsZSknIC91c3Iv
b2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQvdG1wL3Vzci9pbmNsdWRlL3N5cy9zeXN0bS5oOjM4Mjoz
OTogZXJyb3I6DQp1bmtub3duIHR5cGUgbmFtZSAndWludGZwdHJfdCc7IGRpZCB5b3UgbWVhbiAn
dWludHB0cl90Jz8gdm9pZCAgICBwcm9mY2xvY2soaW50IGNudCwgaW50DQp1c2VybW9kZSwgdWlu
dGZwdHJfdCBwYyk7IF4NCi91c3Ivb2JqL3Vzci9zcmMvYW1kNjQuYW1kNjQvdG1wL3Vzci9pbmNs
dWRlL3N5cy9fc3RkaW50Lmg6ODA6MjI6IG5vdGU6ICd1aW50cHRyX3QnIGRlY2xhcmVkDQpoZXJl
IHR5cGVkZWYgX191aW50cHRyX3QgICAgICAgICAgICAgdWludHB0cl90Ow0KDQoNCklzIHRoZXJl
IGFuIGluY2x1ZGUgbWlzc2luZz8NCg0KS2luZCByZWdhcmRzLA0KDQpPLiBIYXJ0bWFubg0KDQot
IC0tIA0KTy4gSGFydG1hbm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVuZyBvZGVyIMOc
YmVybWl0dGx1bmcgbWVpbmVyIERhdGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIgZsO8ciBkaWUg
TWFya3QtIG9kZXIgTWVpbnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNHKS4NCi0tLS0t
QkVHSU4gUEdQIFNJR05BVFVSRS0tLS0tDQoNCmlIVUVBUllJQUIwV0lRU3k4SUJ4QVBEa3FWQmFU
SjQ0TjFaWlBiYTVSd1VDWExvMnN3QUtDUkE0TjFaWlBiYTUNClIwQWJBUDQyRi9UeWZtZ2tIM0k5
SlFYdHUyMkREbHc2YVZvTzRQTjU2VmpBWVZjN2dRRUFnbzE5dnhEejJadXANCm5ZZnlvaVRNRGxq
MWIwOHN1SUduMnFlKy9KT0poQUU9DQo9UnFLOQ0KLS0tLS1FTkQgUEdQIFNJR05BVFVSRS0tLS0t
DQo=

From owner-svn-src-head@freebsd.org  Fri Apr 19 21:17:21 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD75215790FC;
 Fri, 19 Apr 2019 21:17:20 +0000 (UTC)
 (envelope-from ml+freebsd@vishwin.info)
Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "varun.vishwin.info",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id D2F196C137;
 Fri, 19 Apr 2019 21:17:19 +0000 (UTC)
 (envelope-from ml+freebsd@vishwin.info)
Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2])
 by varun.vishwin.info (OpenSMTPD) with ESMTP id df32beb9;
 Fri, 19 Apr 2019 17:17:14 -0400 (EDT)
Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]
 (2001:470:8:6ca:cad7:19ff:fec0:a06d
 [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d])
 by varun.vishwin.info (OpenSMTPD) with ESMTPSA id b46e0e7f
 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO;
 Fri, 19 Apr 2019 17:17:14 -0400 (EDT)
Subject: Re: svn commit: r346410 - in head: lib/libc/gen share/man/man9
 sys/conf sys/libkern sys/sys
To: "O. Hartmann" , Conrad Meyer 
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
References: <201904192005.x3JK5mhm015801@repo.freebsd.org>
 <20190419225931.1311745d@thor.intern.walstatt.dynvpn.de>
From: Charlie Li 
Openpgp: preference=signencrypt
Autocrypt: addr=ml+freebsd@vishwin.info; keydata=
 mQINBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3
 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j
 NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5
 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z
 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9
 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ
 M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ
 BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe
 CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0
 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABtC5DaGFybGllIExp
 IChGcmVlQlNEKSA8bWwrZnJlZWJzZEB2aXNod2luLmluZm8+iQJOBBMBCAA4FiEE/3/Cqr5a
 +41PbEb+jnB43vIDq2wFAlt7iwoCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQjnB4
 3vIDq2zlBQ/7Boe3K9i4pxvIlBWlFDmDuclLiju/LTsc81mO607TIwUMx5p3BfnhqTwqpcuT
 Gilj2JKSlIw0NioJ3HnPiPyIpMmOmdeLBwvBn8iBmjs14DdDMgKusE8gKc0KRFbTM397rB7K
 oXj2/R8VF3Uuo8i3vlWyah6p+Osz1dAad/7COqPeM9OBMKaYAOrdKvxMC96l5k+Wc1JKOLeA
 BP7BtgmQB7HydHUm+dzqUB1rgMP2djIXd5Ngc749kzNQIFvC9ZXbaABw5M4JqKRbVFm08Wgw
 IUyhkNEtMpkBxMPwqXsk3t1KVptYQSAfW/+8mWDP2sgUOyz9O2IBfb1acCPk04/jf8SsXRaT
 HzJr64NseWlZUHAMYl9EC09gdE6UDCIHR68+IzutMtgT17Djuu1HRYly+RWAGkyTOeR7Sv/V
 2B89Nsq5OfHYs3F2vD57/aRj5TmZJDQWxH/rDYbj8Pk6UjXcaY6QWUtNFidvCMFlBpXuncXU
 ZWgTsJEyZLHP5SJ7S9sRSHU5+CVUkjsbEFNuHkkGHAkSnpP+HosnH8/q9Rykn9FTamLbiQRQ
 UxJ6+IlqvOUtRRrMGMBF7ZIFGHcl8tcKynsPTeaHjpqPhCrZx8PmCKKoJHwW4Ua7+cdZkBJq
 R20qvXuLIrInjkIpA1CbacMckS5a7el6pi/nU0NG1S1K4Zu5Ag0EW3uIdQEQANdl7YHG8JOy
 HbEYv+7ExSrO96qBRavg1FsDG0riDmlsOSfZ2fqL6/YJF5WsfsX99+YSdIiLQfC4QOw/cA+M
 I65pgY4cCu42L7YIW/AR+jB1hFg+Q/cbeOwjuKPFYtZvxeDpSsaA6iIR+p+t4DXkjWl86g6W
 aFLC+til/rCilFHY/1/6M918F1gm/6xCIADDFu0BXLkASc5B4LuvaFEiJIuI9ZoQDIgWxnsX
 0tXXE36SwK/XrowzRzsOa+2iOHAPKu7rPGHwy28vO4T5Uq7UynMZG2sK3RTbOijaxL4IJF4W
 MRqpuGdBSJ4sWmr5aIpgX9au5L1TNAAILJpHXnkv+k825+9VgbhFtFYBHEkgUtXb+w34JnkH
 okpr9A78dpWb+T+jOEP6ZUgM+4VVy+hCCpbcCVI2PEXu8w2z3+4yZWxIFmy8UYZRoeTMKzV2
 zLeisoA0XA8jj548YNPiAl20Mjyoqu42WNv0P8fD9PMTcfLFCj2PlxOhuUFaIUH3ty0/bNeS
 jPtVK+L9x4W37R7U1tYk+tB5MlPakQiSQtdToB+8K34rnBt/3kCoAYL7Hygw9+qyZrEKZDtP
 5JKekfgsy28t1z66xWCUwq9PHuUFiij3cjbwIbskI9uy2+xITcXt4ZqVfpZcdGmjfbdTPkGf
 PH2pjDoCJaezYdbha/3OVhmVABEBAAGJAjYEGAEIACAWIQT/f8Kqvlr7jU9sRv6OcHje8gOr
 bAUCW3uIdQIbDAAKCRCOcHje8gOrbExnD/9qwSL4HiorJmUEJ+5CTh8IJql4PzeQK8Dx93gi
 Zs5jWVlCJTmcpQNirWIZM2eRt67C/wTJjLmEVGzySVLpGiUqhXqdROgFmDwvEnmpIbtWWyvG
 sgSOCmZj/tz0GEtLSsjJcV/kLffkv7XEKkt9ZjIJnFYVYSovDK1o2PoO6Rfi5AWHHB7jYhjS
 HJvJjDx0yClO9gEYhtw7R60YOLH+cKoDou9tu+4wR3QwRsNGO6wrzLGhptxuBrDMI+HuOx+j
 wBTliuzuvZrry6OdKDDdq5D4vvQCj4vFnK4p7LZXhBshCMoLkWoA0I2T+YF/V5Ob5EuvsTIC
 re/pO/g941ipVkehvVNAsiplSaHjasB1HS6BQ95csI8E/b6PnKm+IECp2bANbLP1jrxKeBGj
 UkeyRxTmOV/ADUIIj8S4a2yOxTxlysN2O5wqXCJcxaYelC/Y4TUcL6ENxn2dLBdCYKQEna0u
 DdxZp7fS+pXN6qyK8Qz6Q42MHAxFAZdLKf6a44d4HQt6rPcWdETVlnVKnJr0b9kg5K1Q8N4k
 PVoTGVrkGAZhmjFYsqWulq445VU46mX7WcqsrZx8LqNTwP6i3Bf71FJ9EBxTyA8fP8k0qosP
 8U8D7jhcc5x4yVW8RBBtB+a5q3odWdFnjMLEm4wtxBH/mSN/UKRcFSBvKQ8FxTgpX4Yxcw==
Organization: FreeBSD
Message-ID: 
Date: Fri, 19 Apr 2019 17:17:07 -0400
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <20190419225931.1311745d@thor.intern.walstatt.dynvpn.de>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="ZHHnbvi9607DH2TbTd5XfiWzWZ7UlhxDy"
X-Rspamd-Queue-Id: D2F196C137
X-Spamd-Bar: ------
X-Spamd-Result: default: False [-6.95 / 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.95)[-0.954,0]; TAGGED_FROM(0.00)[freebsd]
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, 19 Apr 2019 21:17:21 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--ZHHnbvi9607DH2TbTd5XfiWzWZ7UlhxDy
Content-Type: multipart/mixed; boundary="2BfhjZzXBVR6jvpMGLa18sYNs5kEXT3FD";
 protected-headers="v1"
From: Charlie Li 
To: "O. Hartmann" , Conrad Meyer 
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
Message-ID: 
Subject: Re: svn commit: r346410 - in head: lib/libc/gen share/man/man9
 sys/conf sys/libkern sys/sys
References: <201904192005.x3JK5mhm015801@repo.freebsd.org>
 <20190419225931.1311745d@thor.intern.walstatt.dynvpn.de>
In-Reply-To: <20190419225931.1311745d@thor.intern.walstatt.dynvpn.de>

--2BfhjZzXBVR6jvpMGLa18sYNs5kEXT3FD
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB-large
Content-Transfer-Encoding: quoted-printable

O. Hartmann wrote:
> Am Fri, 19 Apr 2019 20:05:48 +0000 (UTC) Conrad Meyer schrieb:
>> Modified: head/lib/libc/gen/Makefile.inc
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/lib/libc/gen/Makefile.inc	Fri Apr 19 19:45:19 2019	(r346409)
>> +++ head/lib/libc/gen/Makefile.inc	Fri Apr 19 20:05:47 2019	(r346410)
>> @@ -3,6 +3,7 @@
>=20
>>  # machine-independent gen sources
>>  .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
>> +.PATH: ${SRCTOP}/sys/libkern
>=20
>>  CONFS=3D	shells
>=20
>=20
> After applying r346410 to our source tree, buildworld fails (WITH_META_=
MODE is set):
>=20
> [...]
> Building /usr/obj/usr/src/amd64.amd64/lib/libc/ev_timers.o
> --- inet_ntoa.o ---
> In file included from /usr/src/sys/libkern/inet_ntoa.c:34:
> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/systm.h:172:8: error: =
unknown type name 'bool'
> extern bool dynamic_kenv;
>        ^
> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/systm.h:211:5: warning=
: declaration of
> built-in function 'setjmp' requires inclusion of the header 
> [-Wbuiltin-requires-header] int     setjmp(struct _jmp_buf *) __returns=
_twice; ^
> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/systm.h:212:6: warning=
: declaration of
> built-in function 'longjmp' requires inclusion of the header =

> [-Wbuiltin-requires-header] void    longjmp(struct _jmp_buf *, int) __d=
ead2; ^
> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/systm.h:285:6: warning=
: incompatible
> redeclaration of library function 'log' [-Wincompatible-library-redecla=
ration] void
> log(int, const char *, ...) __printflike(2, 3); ^
> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/systm.h:285:6: note: '=
log' is a builtin with
> type 'double (double)' /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys=
/systm.h:382:39: error:
> unknown type name 'uintfptr_t'; did you mean 'uintptr_t'? void    profc=
lock(int cnt, int
> usermode, uintfptr_t pc); ^
> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/_stdint.h:80:22: note:=
 'uintptr_t' declared
> here typedef __uintptr_t             uintptr_t;
>=20
>=20
> Is there an include missing?
> Beat me to the initial email. With the specific file change quoted
above, looks like inet_*.c are getting pulled from sys/libkern instead
of the proper lib/libc/inet.

--=20
Charlie Li
=E2=80=A6nope, still don't have an exit line.

(This email address is for mailing list use; replace local-part with
vishwin for off-list communication if possible)


--2BfhjZzXBVR6jvpMGLa18sYNs5kEXT3FD--

--ZHHnbvi9607DH2TbTd5XfiWzWZ7UlhxDy
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAly6OtMACgkQjnB43vID
q2wUgQ/+MoQ4p3qlILb3ytLESCts57WC/oAlm4rSPUxFjvpmxRp7SiCAFSXNLhRj
KANK5i6QEU1K+9YjwyuVz2wtUBdACy4Mt0qIBCEhJTQpBpMOQkuuTHdJIZpsbGy/
6TuijkaIVXVkgpyOEXoVUR4TlNW6yME2FdRjwRwwV2+3KcILJ/OQMSIcjrOo5RpJ
FRLyjHOhxbqtoxQ8Nwc2WnOTmwFFudozvJaJ4iCze1x8uD0QGxRbt0WjATCYtNCE
/49djSVysxQnBYR1FK3wNQpFpHHtAYiQ14QXXZOzYRaH/VFfZ4ScMG33OUfAxoPW
ISHO3nGl/aqsRv1LSkmeitkWatFfHd/q+tO6a7d05Cvwy3+bh0fZDJvvCggfufTG
ewxOYw2iKLxsUl940SBmYV4tiDaF5OFY53hnq8K6L7jEJZauC91jB1DmPP89MUK3
4+ylXu4J+8d6BnJsGXkPYcs69XPvLcL3437d/OAhxKG3N5EE2ZS13kWsbLgWOSJQ
4KumLUHlo/Vuo9mmkG44xpSHaSs0KYve792OQR8NY8ii9HQ+pOYJkCwSr4o5MXFE
bAHZKQzMy70fC7Jk2B1h2KucA+3Ej38Ar+XMyFBkioeO0bl0Vy6AyhYsh9sumACW
qHnFumjWk5N2/TcM4ECocg9F0GGpvfg/BPbbnr4d2nMY1zji7jQ=
=4brR
-----END PGP SIGNATURE-----

--ZHHnbvi9607DH2TbTd5XfiWzWZ7UlhxDy--

From owner-svn-src-head@freebsd.org  Fri Apr 19 21:58:52 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A2D5157A1C6;
 Fri, 19 Apr 2019 21:58:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 F14296D60D;
 Fri, 19 Apr 2019 21:58:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB8D14AD3;
 Fri, 19 Apr 2019 21:58:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JLwpta074046;
 Fri, 19 Apr 2019 21:58:51 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JLwpOV074045;
 Fri, 19 Apr 2019 21:58:51 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201904192158.x3JLwpOV074045@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Fri, 19 Apr 2019 21:58:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346419 - head/tests/sys/opencrypto
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: head/tests/sys/opencrypto
X-SVN-Commit-Revision: 346419
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: F14296D60D
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.981,0];
 NEURAL_HAM_LONG(-1.00)[-1.000,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, 19 Apr 2019 21:58:52 -0000

Author: jhb
Date: Fri Apr 19 21:58:51 2019
New Revision: 346419
URL: https://svnweb.freebsd.org/changeset/base/346419

Log:
  Sync cryptographic algorithm constants with current cryptodev.h.
  
  Reviewed by:	cem
  MFC after:	2 weeks
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D19881

Modified:
  head/tests/sys/opencrypto/cryptodevh.py

Modified: head/tests/sys/opencrypto/cryptodevh.py
==============================================================================
--- head/tests/sys/opencrypto/cryptodevh.py	Fri Apr 19 21:50:23 2019	(r346418)
+++ head/tests/sys/opencrypto/cryptodevh.py	Fri Apr 19 21:58:51 2019	(r346419)
@@ -197,7 +197,19 @@ CRYPTO_AES_NIST_GCM_16 = 25
 CRYPTO_AES_128_NIST_GMAC = 26
 CRYPTO_AES_192_NIST_GMAC = 27
 CRYPTO_AES_256_NIST_GMAC = 28
-CRYPTO_ALGORITHM_MAX = 28
+CRYPTO_BLAKE2B = 29
+CRYPTO_BLAKE2S = 30
+CRYPTO_CHACHA20 = 31
+CRYPTO_SHA2_224_HMAC = 32
+CRYPTO_RIPEMD160 = 33
+CRYPTO_SHA2_224 = 34
+CRYPTO_SHA2_256 = 35
+CRYPTO_SHA2_384 = 36
+CRYPTO_SHA2_512 = 37
+CRYPTO_POLY1305 = 38
+CRYPTO_AES_CCM_CBC_MAC = 39
+CRYPTO_AES_CCM_16 = 40
+CRYPTO_ALGORITHM_MAX = 40
 CRYPTO_ALG_FLAG_SUPPORTED = 0x01
 CRYPTO_ALG_FLAG_RNG_ENABLE = 0x02
 CRYPTO_ALG_FLAG_DSA_SHA = 0x04

From owner-svn-src-head@freebsd.org  Fri Apr 19 22:08:20 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC649157A46B;
 Fri, 19 Apr 2019 22:08:19 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.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 6B7096DAE6;
 Fri, 19 Apr 2019 22:08:19 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22E3E4C84;
 Fri, 19 Apr 2019 22:08:19 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JM8JST079289;
 Fri, 19 Apr 2019 22:08:19 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JM8HWM079280;
 Fri, 19 Apr 2019 22:08:17 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201904192208.x3JM8HWM079280@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Fri, 19 Apr 2019 22:08:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346420 - in head: lib/libc/gen share/man/man9 sys/conf
 sys/libkern sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: in head: lib/libc/gen share/man/man9 sys/conf sys/libkern
 sys/sys
X-SVN-Commit-Revision: 346420
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 6B7096DAE6
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)[-1.000,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, 19 Apr 2019 22:08:20 -0000

Author: cem
Date: Fri Apr 19 22:08:17 2019
New Revision: 346420
URL: https://svnweb.freebsd.org/changeset/base/346420

Log:
  Revert r346410 and r346411
  
  libkern in .PATH has too many filename conflicts with libc and my -DNO_CLEAN
  tinderbox didn't catch that ahead of time.  Mea culpa.

Added:
  head/lib/libc/gen/arc4random_uniform.c
     - copied unchanged from r346409, head/lib/libc/gen/arc4random_uniform.c
Deleted:
  head/sys/libkern/arc4random_uniform.c
Modified:
  head/lib/libc/gen/Makefile.inc
  head/share/man/man9/Makefile
  head/share/man/man9/random.9
  head/sys/conf/files
  head/sys/sys/libkern.h
  head/sys/sys/param.h

Modified: head/lib/libc/gen/Makefile.inc
==============================================================================
--- head/lib/libc/gen/Makefile.inc	Fri Apr 19 21:58:51 2019	(r346419)
+++ head/lib/libc/gen/Makefile.inc	Fri Apr 19 22:08:17 2019	(r346420)
@@ -3,7 +3,6 @@
 
 # machine-independent gen sources
 .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
-.PATH: ${SRCTOP}/sys/libkern
 
 CONFS=	shells
 

Copied: head/lib/libc/gen/arc4random_uniform.c (from r346409, head/lib/libc/gen/arc4random_uniform.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/gen/arc4random_uniform.c	Fri Apr 19 22:08:17 2019	(r346420, copy of r346409, head/lib/libc/gen/arc4random_uniform.c)
@@ -0,0 +1,58 @@
+/*	$OpenBSD: arc4random_uniform.c,v 1.2 2015/09/13 08:31:47 guenther Exp $	*/
+
+/*
+ * Copyright (c) 2008, Damien Miller 
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+
+/*
+ * Calculate a uniformly distributed random number less than upper_bound
+ * avoiding "modulo bias".
+ *
+ * Uniformity is achieved by generating new random numbers until the one
+ * returned is outside the range [0, 2**32 % upper_bound).  This
+ * guarantees the selected random number will be inside
+ * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound)
+ * after reduction modulo upper_bound.
+ */
+uint32_t
+arc4random_uniform(uint32_t upper_bound)
+{
+	uint32_t r, min;
+
+	if (upper_bound < 2)
+		return 0;
+
+	/* 2**32 % x == (2**32 - x) % x */
+	min = -upper_bound % upper_bound;
+
+	/*
+	 * This could theoretically loop forever but each retry has
+	 * p > 0.5 (worst case, usually far better) of selecting a
+	 * number inside the range we need, so it should rarely need
+	 * to re-roll.
+	 */
+	for (;;) {
+		r = arc4random();
+		if (r >= min)
+			break;
+	}
+
+	return r % upper_bound;
+}

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Fri Apr 19 21:58:51 2019	(r346419)
+++ head/share/man/man9/Makefile	Fri Apr 19 22:08:17 2019	(r346420)
@@ -1668,8 +1668,6 @@ MLINKS+=psignal.9 gsignal.9 \
 	psignal.9 tdsignal.9
 MLINKS+=random.9 arc4rand.9 \
 	random.9 arc4random.9 \
-	random.9 arc4random_buf.9 \
-	random.9 arc4random_uniform.9 \
 	random.9 is_random_seeded.9 \
 	random.9 read_random.9 \
 	random.9 read_random_uio.9 \

Modified: head/share/man/man9/random.9
==============================================================================
--- head/share/man/man9/random.9	Fri Apr 19 21:58:51 2019	(r346419)
+++ head/share/man/man9/random.9	Fri Apr 19 22:08:17 2019	(r346420)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\" "
-.Dd April 19, 2019
+.Dd April 16, 2019
 .Dt RANDOM 9
 .Os
 .Sh NAME
@@ -45,8 +45,6 @@
 .Fn arc4random "void"
 .Ft void
 .Fn arc4random_buf "void *ptr" "size_t len"
-.Ft uint32_t
-.Fn arc4random_uniform "uint32_t upper_bound"
 .Ft void
 .Fn arc4rand "void *ptr" "u_int length" "int reseed"
 .Pp
@@ -81,15 +79,6 @@ fills
 with
 .Fa len
 bytes of random data.
-.Pp
-.Fn arc4random_uniform
-will return a single 32-bit value, uniformly distributed but less than
-.Fa upper_bound .
-This is recommended over constructions like
-.Dq Li arc4random() % upper_bound
-as it avoids "modulo bias" when the upper bound is not a power of two.
-In the worst case, this function may consume multiple iterations
-to ensure uniformity.
 .Pp
 The
 .Fn arc4rand

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Apr 19 21:58:51 2019	(r346419)
+++ head/sys/conf/files	Fri Apr 19 22:08:17 2019	(r346420)
@@ -3985,7 +3985,6 @@ kgssapi/gsstest.c		optional kgssapi_debug
 # the file should be moved to conf/files. from here.
 #
 libkern/arc4random.c		standard
-libkern/arc4random_uniform.c	standard
 crypto/chacha20/chacha.c	standard
 libkern/asprintf.c		standard
 libkern/bcd.c			standard

Modified: head/sys/sys/libkern.h
==============================================================================
--- head/sys/sys/libkern.h	Fri Apr 19 21:58:51 2019	(r346419)
+++ head/sys/sys/libkern.h	Fri Apr 19 22:08:17 2019	(r346420)
@@ -128,7 +128,6 @@ struct malloc_type;
 uint32_t arc4random(void);
 void	 arc4random_buf(void *, size_t);
 void	 arc4rand(void *, u_int, int);
-uint32_t arc4random_uniform(uint32_t);
 int	 timingsafe_bcmp(const void *, const void *, size_t);
 void	*bsearch(const void *, const void *, size_t,
 	    size_t, int (*)(const void *, const void *));

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Fri Apr 19 21:58:51 2019	(r346419)
+++ head/sys/sys/param.h	Fri Apr 19 22:08:17 2019	(r346420)
@@ -60,7 +60,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300021	/* Master, propagated to newvers */
+#define __FreeBSD_version 1300020	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-head@freebsd.org  Fri Apr 19 22:20:43 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5658E157A70B;
 Fri, 19 Apr 2019 22:20:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 E85806E023;
 Fri, 19 Apr 2019 22:20:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF5FC4E6C;
 Fri, 19 Apr 2019 22:20:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JMKgkP084685;
 Fri, 19 Apr 2019 22:20:42 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JMKg0s084684;
 Fri, 19 Apr 2019 22:20:42 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201904192220.x3JMKg0s084684@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Fri, 19 Apr 2019 22:20:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346421 - head/tests/sys/opencrypto
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: head/tests/sys/opencrypto
X-SVN-Commit-Revision: 346421
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: E85806E023
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.981,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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, 19 Apr 2019 22:20:43 -0000

Author: jhb
Date: Fri Apr 19 22:20:42 2019
New Revision: 346421
URL: https://svnweb.freebsd.org/changeset/base/346421

Log:
  Test SHA2-224-HMAC now that OCF supports it.
  
  Reviewed by:	cem
  MFC after:	2 weeks
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D19882

Modified:
  head/tests/sys/opencrypto/cryptotest.py

Modified: head/tests/sys/opencrypto/cryptotest.py
==============================================================================
--- head/tests/sys/opencrypto/cryptotest.py	Fri Apr 19 22:08:17 2019	(r346420)
+++ head/tests/sys/opencrypto/cryptotest.py	Fri Apr 19 22:20:42 2019	(r346421)
@@ -279,11 +279,8 @@ def GenTestCase(cname):
 					alg = cryptodev.CRYPTO_SHA1_HMAC
 					blocksize = 64
 				elif hashlen == 28:
-					# Cryptodev doesn't support SHA-224
-					# Slurp remaining input in section
-					for data in lines:
-						continue
-					continue
+					alg = cryptodev.CRYPTO_SHA2_224_HMAC
+					blocksize = 64
 				elif hashlen == 32:
 					alg = cryptodev.CRYPTO_SHA2_256_HMAC
 					blocksize = 64

From owner-svn-src-head@freebsd.org  Fri Apr 19 23:27:28 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79EBF157BF9A;
 Fri, 19 Apr 2019 23:27:28 +0000 (UTC)
 (envelope-from rmacklem@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 13C4470B63;
 Fri, 19 Apr 2019 23:27:28 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F04195A20;
 Fri, 19 Apr 2019 23:27:23 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JNRN8m023727;
 Fri, 19 Apr 2019 23:27:23 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JNRNOY023726;
 Fri, 19 Apr 2019 23:27:23 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904192327.x3JNRNOY023726@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
 rmacklem@FreeBSD.org using -f
From: Rick Macklem 
Date: Fri, 19 Apr 2019 23:27:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346423 - head/sys/fs/nfsserver
X-SVN-Group: head
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: head/sys/fs/nfsserver
X-SVN-Commit-Revision: 346423
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 13C4470B63
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.952,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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, 19 Apr 2019 23:27:28 -0000

Author: rmacklem
Date: Fri Apr 19 23:27:23 2019
New Revision: 346423
URL: https://svnweb.freebsd.org/changeset/base/346423

Log:
  Replace "vp" with NULL to make the code more readable.
  
  At the time of this nfsv4_sattr() call, "vp == NULL", so this patch doesn't
  change the semantics, but I think it makes the code more readable.
  It also makes it consistent with the nfsv4_sattr() call a few lines above
  this one. Found during code inspection.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdserv.c

Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdserv.c	Fri Apr 19 23:04:07 2019	(r346422)
+++ head/sys/fs/nfsserver/nfs_nfsdserv.c	Fri Apr 19 23:27:23 2019	(r346423)
@@ -2886,7 +2886,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is
 			NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF);
 			cverf[0] = *tl++;
 			cverf[1] = *tl;
-			error = nfsv4_sattr(nd, vp, &nva, &attrbits, aclp, p);
+			error = nfsv4_sattr(nd, NULL, &nva, &attrbits, aclp, p);
 			if (error != 0)
 				goto nfsmout;
 			if (NFSISSET_ATTRBIT(&attrbits,

From owner-svn-src-head@freebsd.org  Fri Apr 19 23:35:09 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C567B157C2CB;
 Fri, 19 Apr 2019 23:35:09 +0000 (UTC)
 (envelope-from rmacklem@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 300B57158D;
 Fri, 19 Apr 2019 23:35:09 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03F235BD8;
 Fri, 19 Apr 2019 23:35:09 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3JNZ8IE029227;
 Fri, 19 Apr 2019 23:35:08 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3JNZ81b029224;
 Fri, 19 Apr 2019 23:35:08 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904192335.x3JNZ81b029224@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
 rmacklem@FreeBSD.org using -f
From: Rick Macklem 
Date: Fri, 19 Apr 2019 23:35:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346424 - in head/sys/fs: nfs nfsserver
X-SVN-Group: head
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver
X-SVN-Commit-Revision: 346424
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 300B57158D
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_SHORT(-0.95)[-0.954,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)[-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, 19 Apr 2019 23:35:10 -0000

Author: rmacklem
Date: Fri Apr 19 23:35:08 2019
New Revision: 346424
URL: https://svnweb.freebsd.org/changeset/base/346424

Log:
  Add support for the ModeSetMasked attribute to the NFSv4.1 server.
  
  I do not know of an extant NFSv4.1 client that currently does a Setattr
  operation for the ModeSetMasked, but it has been discussed on the linux-nfs
  mailing list.
  This patch adds support for doing a Setattr of ModeSetMasked, so that it
  will work for any future NFSv4.1 client that chooses to do so.
  Tested via a hacked FreeBSD NFSv4.1 client.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfs/nfsproto.h
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c

Modified: head/sys/fs/nfs/nfsproto.h
==============================================================================
--- head/sys/fs/nfs/nfsproto.h	Fri Apr 19 23:27:23 2019	(r346423)
+++ head/sys/fs/nfs/nfsproto.h	Fri Apr 19 23:35:08 2019	(r346424)
@@ -1090,7 +1090,7 @@ struct nfsv3_sattr {
  */
 #define	NFSATTRBIT_SUPPSETONLY1	 (NFSATTRBM_TIMEACCESSSET |		\
 				 NFSATTRBM_TIMEMODIFYSET)
-#define	NFSATTRBIT_SUPPSETONLY2	0
+#define	NFSATTRBIT_SUPPSETONLY2	(NFSATTRBM_MODESETMASKED)
 
 /*
  * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31
@@ -1106,7 +1106,8 @@ struct nfsv3_sattr {
  	NFSATTRBM_OWNERGROUP |						\
  	NFSATTRBM_TIMEACCESSSET |					\
  	NFSATTRBM_TIMEMODIFYSET)
-#define	NFSATTRBIT_SETABLE2		0
+#define	NFSATTRBIT_SETABLE2						\
+	(NFSATTRBM_MODESETMASKED)
 
 /*
  * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1.

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Apr 19 23:27:23 2019	(r346423)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Apr 19 23:35:08 2019	(r346424)
@@ -2699,10 +2699,12 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
 	int attrsum = 0;
 	int i, j;
 	int error, attrsize, bitpos, aclsize, aceerr, retnotsup = 0;
-	int toclient = 0;
+	int moderet, toclient = 0;
 	u_char *cp, namestr[NFSV4_SMALLSTR + 1];
 	uid_t uid;
 	gid_t gid;
+	u_short mode, mask;		/* Same type as va_mode. */
+	struct vattr va;
 
 	error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup);
 	if (error)
@@ -2720,6 +2722,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
 	} else {
 		bitpos = 0;
 	}
+	moderet = 0;
 	for (; bitpos < NFSATTRBIT_MAX; bitpos++) {
 	    if (attrsum > attrsize) {
 		error = NFSERR_BADXDR;
@@ -2769,6 +2772,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
 			attrsum += (NFSX_UNSIGNED + NFSM_RNDUP(i));
 			break;
 		case NFSATTRBIT_MODE:
+			moderet = NFSERR_INVAL;	/* Can't do MODESETMASKED. */
 			NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
 			nvap->na_mode = nfstov_mode(*tl);
 			attrsum += NFSX_UNSIGNED;
@@ -2871,6 +2875,32 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str
 			    if (!toclient)
 				nvap->na_vaflags |= VA_UTIMES_NULL;
 			}
+			break;
+		case NFSATTRBIT_MODESETMASKED:
+			NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED);
+			mode = fxdr_unsigned(u_short, *tl++);
+			mask = fxdr_unsigned(u_short, *tl);
+			/*
+			 * vp == NULL implies an Open/Create operation.
+			 * This attribute can only be used for Setattr and
+			 * only for NFSv4.1 or higher.
+			 * If moderet != 0, a mode attribute has also been
+			 * specified and this attribute cannot be done in the
+			 * same Setattr operation.
+			 */
+			if ((nd->nd_flag & ND_NFSV41) == 0)
+				nd->nd_repstat = NFSERR_ATTRNOTSUPP;
+			else if ((mode & ~07777) != 0 || (mask & ~07777) != 0 ||
+			    vp == NULL)
+				nd->nd_repstat = NFSERR_INVAL;
+			else if (moderet == 0)
+				moderet = VOP_GETATTR(vp, &va, nd->nd_cred);
+			if (moderet == 0)
+				nvap->na_mode = (mode & mask) |
+				    (va.va_mode & ~mask);
+			else
+				nd->nd_repstat = moderet;
+			attrsum += 2 * NFSX_UNSIGNED;
 			break;
 		default:
 			nd->nd_repstat = NFSERR_ATTRNOTSUPP;

Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdserv.c	Fri Apr 19 23:27:23 2019	(r346423)
+++ head/sys/fs/nfsserver/nfs_nfsdserv.c	Fri Apr 19 23:35:08 2019	(r346424)
@@ -464,13 +464,18 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int
 		}
 	    }
 	    if (!nd->nd_repstat &&
-		NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE)) {
+		(NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE) ||
+		 NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED))) {
 		NFSVNO_ATTRINIT(&nva2);
 		NFSVNO_SETATTRVAL(&nva2, mode, nva.na_mode);
 		nd->nd_repstat = nfsvno_setattr(vp, &nva2, nd->nd_cred, p,
 		    exp);
-		if (!nd->nd_repstat)
-		    NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE);
+		if (!nd->nd_repstat) {
+		    if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE))
+			NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE);
+		    if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED))
+			NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODESETMASKED);
+		}
 	    }
 
 #ifdef NFS4_ACL_EXTATTR_NAME

From owner-svn-src-head@freebsd.org  Sat Apr 20 02:44:39 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1380D158057F;
 Sat, 20 Apr 2019 02:44:39 +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 A688E76D7D;
 Sat, 20 Apr 2019 02:44:38 +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 7C0F07C5E;
 Sat, 20 Apr 2019 02:44:38 +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 x3K2icJ8029474;
 Sat, 20 Apr 2019 02:44:38 GMT (envelope-from jhibbits@FreeBSD.org)
Received: (from jhibbits@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3K2icC1029473;
 Sat, 20 Apr 2019 02:44:38 GMT (envelope-from jhibbits@FreeBSD.org)
Message-Id: <201904200244.x3K2icC1029473@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to
 jhibbits@FreeBSD.org using -f
From: Justin Hibbits 
Date: Sat, 20 Apr 2019 02:44:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346426 - head/sys/powerpc/powernv
X-SVN-Group: head
X-SVN-Commit-Author: jhibbits
X-SVN-Commit-Paths: head/sys/powerpc/powernv
X-SVN-Commit-Revision: 346426
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: A688E76D7D
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.97)[-0.966,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, 20 Apr 2019 02:44:39 -0000

Author: jhibbits
Date: Sat Apr 20 02:44:38 2019
New Revision: 346426
URL: https://svnweb.freebsd.org/changeset/base/346426

Log:
  powerpc64/powernv: Relax flash block write requirements
  
  Since writes don't necessarily need to be on erase-block boundaries, we can
  relax the block size and alignments down to sector size.  If it needs to be
  erased, opalflash_erase() will check proper alignment and size.

Modified:
  head/sys/powerpc/powernv/opal_flash.c

Modified: head/sys/powerpc/powernv/opal_flash.c
==============================================================================
--- head/sys/powerpc/powernv/opal_flash.c	Sat Apr 20 00:04:31 2019	(r346425)
+++ head/sys/powerpc/powernv/opal_flash.c	Sat Apr 20 02:44:38 2019	(r346426)
@@ -239,8 +239,8 @@ opalflash_write(struct opalflash_softc *sc, off_t off,
 	int rv, size, token;
 
 	/* Ensure we write aligned to a full block size. */
-	if (off % sc->sc_disk->d_stripesize != 0 ||
-	    count % sc->sc_disk->d_stripesize != 0)
+	if (off % sc->sc_disk->d_sectorsize != 0 ||
+	    count % sc->sc_disk->d_sectorsize != 0)
 		return (EIO);
 
 	if (sc->sc_erase) {

From owner-svn-src-head@freebsd.org  Sat Apr 20 02:54:21 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B4A1580A88;
 Sat, 20 Apr 2019 02:54:21 +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 082EA772AA;
 Sat, 20 Apr 2019 02:54:21 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D13407E1A;
 Sat, 20 Apr 2019 02:54:20 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3K2sK9S034414;
 Sat, 20 Apr 2019 02:54:20 GMT (envelope-from kevans@FreeBSD.org)
Received: (from kevans@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3K2sKt1034412;
 Sat, 20 Apr 2019 02:54:20 GMT (envelope-from kevans@FreeBSD.org)
Message-Id: <201904200254.x3K2sKt1034412@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kevans set sender to
 kevans@FreeBSD.org using -f
From: Kyle Evans 
Date: Sat, 20 Apr 2019 02:54:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346427 - in head/usr.sbin/cron: cron crontab
X-SVN-Group: head
X-SVN-Commit-Author: kevans
X-SVN-Commit-Paths: in head/usr.sbin/cron: cron crontab
X-SVN-Commit-Revision: 346427
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 082EA772AA
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];
 NEURAL_HAM_LONG(-1.00)[-1.000,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, 20 Apr 2019 02:54:21 -0000

Author: kevans
Date: Sat Apr 20 02:54:20 2019
New Revision: 346427
URL: https://svnweb.freebsd.org/changeset/base/346427

Log:
  cron(8): schedule interval jobs that get loaded during execution
  
  Jobs using the @ syntax currently only get executed if they exist
  when cron is started. The simplest reproducer of this is:
  
  echo '@20 root echo "Hello!"' >> /etc/cron.d/myjob
  
  myjob will get loaded at the next second==0, but this echo job will not
  run until cron restarts. These jobs are normally handled in
  run_reboot_jobs(), which sets e->lastexit of INTERVAL jobs to the startup
  time so they run 'n' seconds later.
  
  Fix this by special-casing TargetTime > 0 in the database load. Preexisting
  jobs will be handled at startup during run_reboot_jobs as normal, but if
  we've reloaded a database during runtime we'll hit this case and set
  e->lastexit to the current time when we process it. They will then run every
  'n' seconds from that point, and a full restart of cron is no longer
  required to make these jobs work.
  
  Reported by:	Juraj Lutter (otis_sk.freebsd.org)
  Reviewed by:	allanjude, bapt, bjk (earlier version), Juraj Lutter
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D19924

Modified:
  head/usr.sbin/cron/cron/database.c
  head/usr.sbin/cron/crontab/crontab.5

Modified: head/usr.sbin/cron/cron/database.c
==============================================================================
--- head/usr.sbin/cron/cron/database.c	Sat Apr 20 02:44:38 2019	(r346426)
+++ head/usr.sbin/cron/cron/database.c	Sat Apr 20 02:54:20 2019	(r346427)
@@ -259,6 +259,8 @@ process_crontab(uname, fname, tabname, statbuf, new_db
 	struct passwd	*pw = NULL;
 	int		crontab_fd = OK - 1;
 	user		*u;
+	entry		*e;
+	time_t		now;
 
 	if (strcmp(fname, SYS_NAME) && !(pw = getpwnam(uname))) {
 		/* file doesn't have a user in passwd file.
@@ -307,6 +309,21 @@ process_crontab(uname, fname, tabname, statbuf, new_db
 	u = load_user(crontab_fd, pw, fname);
 	if (u != NULL) {
 		u->mtime = statbuf->st_mtime;
+		/*
+		 * TargetTime == 0 when we're initially populating the database,
+		 * and TargetTime > 0 any time after that (i.e. we're reloading
+		 * cron.d/ files because they've been created/modified).  In the
+		 * latter case, we should check for any interval jobs and run
+		 * them 'n' seconds from the time the job was loaded/reloaded.
+		 * Otherwise, they will not be run until cron is restarted.
+		 */
+		if (TargetTime != 0) {
+			now = time(NULL);
+			for (e = u->crontab; e != NULL; e = e->next) {
+				if ((e->flags & INTERVAL) != 0)
+					e->lastexit = now;
+			}
+		}
 		link_user(new_db, u);
 	}
 

Modified: head/usr.sbin/cron/crontab/crontab.5
==============================================================================
--- head/usr.sbin/cron/crontab/crontab.5	Sat Apr 20 02:44:38 2019	(r346426)
+++ head/usr.sbin/cron/crontab/crontab.5	Sat Apr 20 02:54:20 2019	(r346427)
@@ -17,7 +17,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 15, 2019
+.Dd April 19, 2019
 .Dt CRONTAB 5
 .Os
 .Sh NAME
@@ -245,12 +245,14 @@ string		meaning
 The
 .Sq @
 symbol followed by a numeric value has a special notion of running
-a job that much seconds after completion of previous invocation of
+a job that many seconds after completion of the previous invocation of
 the job.
 Unlike regular syntax, it guarantees not to overlap two or more
-invocations of the same job.
-The first run is scheduled specified amount of seconds after cron
-has started.
+invocations of the same job during normal cron execution.
+Note, however, that overlap may occur if the job is running when the file
+containing the job is modified and subsequently reloaded.
+The first run is scheduled for the specified number of seconds after cron
+is started or the crontab entry is reloaded.
 .Sh EXAMPLE CRON FILE
 .Bd -literal
 

From owner-svn-src-head@freebsd.org  Sat Apr 20 03:21:48 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91478158189C;
 Sat, 20 Apr 2019 03:21:48 +0000 (UTC)
 (envelope-from ganbold@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 2D9ED805E5;
 Sat, 20 Apr 2019 03:21:48 +0000 (UTC)
 (envelope-from ganbold@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1FCB82B4;
 Sat, 20 Apr 2019 03:21:47 +0000 (UTC)
 (envelope-from ganbold@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3K3LlRc047957;
 Sat, 20 Apr 2019 03:21:47 GMT (envelope-from ganbold@FreeBSD.org)
Received: (from ganbold@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3K3LlRa047955;
 Sat, 20 Apr 2019 03:21:47 GMT (envelope-from ganbold@FreeBSD.org)
Message-Id: <201904200321.x3K3LlRa047955@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ganbold set sender to
 ganbold@FreeBSD.org using -f
From: Ganbold Tsagaankhuu 
Date: Sat, 20 Apr 2019 03:21:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346428 - in head/sys: arm64/conf conf
X-SVN-Group: head
X-SVN-Commit-Author: ganbold
X-SVN-Commit-Paths: in head/sys: arm64/conf conf
X-SVN-Commit-Revision: 346428
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 2D9ED805E5
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];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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: Sat, 20 Apr 2019 03:21:48 -0000

Author: ganbold
Date: Sat Apr 20 03:21:47 2019
New Revision: 346428
URL: https://svnweb.freebsd.org/changeset/base/346428

Log:
  Add SY8106A Buck Regulator and Allwinner CIR devices to GENERIC arm64 kernel.

Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/conf/files.arm64

Modified: head/sys/arm64/conf/GENERIC
==============================================================================
--- head/sys/arm64/conf/GENERIC	Sat Apr 20 02:54:20 2019	(r346427)
+++ head/sys/arm64/conf/GENERIC	Sat Apr 20 03:21:47 2019	(r346428)
@@ -233,6 +233,7 @@ device		iic
 device		twsi		# Allwinner I2C controller
 device		rk_i2c		# RockChip I2C controller
 device		syr827		# Silergy SYR827 PMIC
+device		sy8106a		# SY8106A Buck Regulator
 
 # Clock and reset controllers
 device		aw_ccu		# Allwinner clock controller
@@ -278,6 +279,7 @@ device		vt_efifb
 device		evdev			# input event device support
 options		EVDEV_SUPPORT		# evdev support in legacy drivers
 device		uinput			# install /dev/uinput cdev
+device		aw_cir
 
 # Pseudo devices.
 device		crypto		# core crypto support

Modified: head/sys/conf/files.arm64
==============================================================================
--- head/sys/conf/files.arm64	Sat Apr 20 02:54:20 2019	(r346427)
+++ head/sys/conf/files.arm64	Sat Apr 20 03:21:47 2019	(r346428)
@@ -27,6 +27,7 @@ cloudabi64_vdso_blob.o		optional	compat_cloudabi64	\
 # Allwinner common files
 arm/allwinner/a10_ehci.c	optional	ehci aw_ehci fdt
 arm/allwinner/a10_timer.c	optional	a10_timer fdt
+arm/allwinner/aw_cir.c		optional	evdev aw_cir fdt
 arm/allwinner/aw_gpio.c		optional	gpio aw_gpio fdt
 arm/allwinner/aw_mmc.c		optional	mmc aw_mmc fdt | mmccam aw_mmc fdt
 arm/allwinner/aw_nmi.c		optional	aw_nmi fdt \
@@ -206,6 +207,7 @@ dev/axgbe/xgbe-dev.c		optional	axgbe
 dev/axgbe/xgbe-drv.c		optional	axgbe
 dev/axgbe/xgbe-mdio.c		optional	axgbe
 dev/cpufreq/cpufreq_dt.c	optional	cpufreq fdt
+dev/iicbus/sy8106a.c		optional	sy8106a fdt
 dev/iicbus/twsi/mv_twsi.c	optional	twsi fdt
 dev/iicbus/twsi/a10_twsi.c	optional	twsi fdt
 dev/iicbus/twsi/twsi.c		optional	twsi fdt

From owner-svn-src-head@freebsd.org  Sat Apr 20 05:31:58 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7E871583D16;
 Sat, 20 Apr 2019 05:31:57 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 769F283B0A;
 Sat, 20 Apr 2019 05:31:57 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 506AC9923;
 Sat, 20 Apr 2019 05:31:57 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3K5Vv3O015580;
 Sat, 20 Apr 2019 05:31:57 GMT (envelope-from imp@FreeBSD.org)
Received: (from imp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3K5VuCb015576;
 Sat, 20 Apr 2019 05:31:56 GMT (envelope-from imp@FreeBSD.org)
Message-Id: <201904200531.x3K5VuCb015576@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org
 using -f
From: Warner Losh 
Date: Sat, 20 Apr 2019 05:31:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346430 - in head/stand/efi: include libefi loader
X-SVN-Group: head
X-SVN-Commit-Author: imp
X-SVN-Commit-Paths: in head/stand/efi: include libefi loader
X-SVN-Commit-Revision: 346430
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 769F283B0A
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)[-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: Sat, 20 Apr 2019 05:31:58 -0000

Author: imp
Date: Sat Apr 20 05:31:56 2019
New Revision: 346430
URL: https://svnweb.freebsd.org/changeset/base/346430

Log:
  Start to reduce the number of #ifdef EFI_ZFS_BOOT
  
  There's a number of EFI_ZFS_BOOT #ifdefs that aren't needed, or can be
  eliminated with some trivial #defines. Remove the EFI_ZFS_BOOT ifdefs
  that aren't needed. Replace libzfs.h include which is not safe to
  include without EFI_ZFS_BOOT with efizfs.h which is and now
  conditionally included libzfs.h. Define efizfs_set_preferred away
  and define efi_zfs_probe to NULL when ZFS is compiled out.

Modified:
  head/stand/efi/include/efizfs.h
  head/stand/efi/libefi/devicename.c
  head/stand/efi/loader/conf.c
  head/stand/efi/loader/main.c

Modified: head/stand/efi/include/efizfs.h
==============================================================================
--- head/stand/efi/include/efizfs.h	Sat Apr 20 04:16:51 2019	(r346429)
+++ head/stand/efi/include/efizfs.h	Sat Apr 20 05:31:56 2019	(r346430)
@@ -33,6 +33,8 @@
 #define _EFIZFS_H_
 
 #ifdef EFI_ZFS_BOOT
+#include 
+
 typedef STAILQ_HEAD(zfsinfo_list, zfsinfo) zfsinfo_list_t;
 
 typedef struct zfsinfo
@@ -50,6 +52,9 @@ bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *)
 zfsinfo_list_t *efizfs_get_zfsinfo_list(void);
 void efizfs_set_preferred(EFI_HANDLE);
 
+#else
+#define efizfs_set_preferred(x)
+#define efi_zfs_probe NULL
 #endif
 
 #endif

Modified: head/stand/efi/libefi/devicename.c
==============================================================================
--- head/stand/efi/libefi/devicename.c	Sat Apr 20 04:16:51 2019	(r346429)
+++ head/stand/efi/libefi/devicename.c	Sat Apr 20 05:31:56 2019	(r346430)
@@ -34,12 +34,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef EFI_ZFS_BOOT
-#include 
-#endif
 
 #include 
 #include 
+#include 
 
 static int efi_parsedev(struct devdesc **, const char *, const char **);
 

Modified: head/stand/efi/loader/conf.c
==============================================================================
--- head/stand/efi/loader/conf.c	Sat Apr 20 04:16:51 2019	(r346429)
+++ head/stand/efi/loader/conf.c	Sat Apr 20 05:31:56 2019	(r346430)
@@ -31,9 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef EFI_ZFS_BOOT
-#include 
-#endif
+#include 
 
 struct devsw *devsw[] = {
 	&efipart_fddev,

Modified: head/stand/efi/loader/main.c
==============================================================================
--- head/stand/efi/loader/main.c	Sat Apr 20 04:16:51 2019	(r346429)
+++ head/stand/efi/loader/main.c	Sat Apr 20 05:31:56 2019	(r346430)
@@ -50,10 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef EFI_ZFS_BOOT
-#include 
 #include "efizfs.h"
-#endif
 
 #include "loader_efi.h"
 
@@ -763,18 +760,14 @@ main(int argc, CHAR16 *argv[])
 	archsw.arch_copyin = efi_copyin;
 	archsw.arch_copyout = efi_copyout;
 	archsw.arch_readin = efi_readin;
-#ifdef EFI_ZFS_BOOT
-	/* Note this needs to be set before ZFS init. */
 	archsw.arch_zfs_probe = efi_zfs_probe;
-#endif
 
         /* Get our loaded image protocol interface structure. */
 	BS->HandleProtocol(IH, &imgid, (VOID**)&img);
 
-#ifdef EFI_ZFS_BOOT
-	/* Tell ZFS probe code where we booted from */
+	/* Tell ZFS probe code where we booted from, if zfs configured */
 	efizfs_set_preferred(img->DeviceHandle);
-#endif
+
 	/* Init the time source */
 	efi_time_init();
 

From owner-svn-src-head@freebsd.org  Sat Apr 20 07:32:31 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FE461585FD1;
 Sat, 20 Apr 2019 07:32:31 +0000 (UTC)
 (envelope-from lwhsu@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 DB58A869F3;
 Sat, 20 Apr 2019 07:32:30 +0000 (UTC)
 (envelope-from lwhsu@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5E2FAE4F;
 Sat, 20 Apr 2019 07:32:30 +0000 (UTC)
 (envelope-from lwhsu@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3K7WULR080892;
 Sat, 20 Apr 2019 07:32:30 GMT (envelope-from lwhsu@FreeBSD.org)
Received: (from lwhsu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3K7WUuM080887;
 Sat, 20 Apr 2019 07:32:30 GMT (envelope-from lwhsu@FreeBSD.org)
Message-Id: <201904200732.x3K7WUuM080887@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to
 lwhsu@FreeBSD.org using -f
From: Li-Wen Hsu 
Date: Sat, 20 Apr 2019 07:32:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346431 - head/tests/sys/opencrypto
X-SVN-Group: head
X-SVN-Commit-Author: lwhsu
X-SVN-Commit-Paths: head/tests/sys/opencrypto
X-SVN-Commit-Revision: 346431
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: DB58A869F3
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)[-1.000,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, 20 Apr 2019 07:32:31 -0000

Author: lwhsu
Date: Sat Apr 20 07:32:29 2019
New Revision: 346431
URL: https://svnweb.freebsd.org/changeset/base/346431

Log:
  Specify using Python2, these .py files have not been converted to use Python3
  yet, but the default Python version in ports has been switched to 3.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/tests/sys/opencrypto/Makefile
  head/tests/sys/opencrypto/cryptodev.py
  head/tests/sys/opencrypto/cryptotest.py
  head/tests/sys/opencrypto/runtests.sh

Modified: head/tests/sys/opencrypto/Makefile
==============================================================================
--- head/tests/sys/opencrypto/Makefile	Sat Apr 20 05:31:56 2019	(r346430)
+++ head/tests/sys/opencrypto/Makefile	Sat Apr 20 07:32:29 2019	(r346431)
@@ -14,7 +14,7 @@ ATF_TESTS_C+=	blake2_test poly1305_test
 
 PLAIN_TESTS_SH=	runtests
 
-TEST_METADATA.runtests+= required_programs="python"
+TEST_METADATA.runtests+= required_programs="python2"
 TEST_METADATA.runtests+= required_user="root"
 
 PYMODULES=	cryptodev.py cryptodevh.py cryptotest.py dpkt.py

Modified: head/tests/sys/opencrypto/cryptodev.py
==============================================================================
--- head/tests/sys/opencrypto/cryptodev.py	Sat Apr 20 05:31:56 2019	(r346430)
+++ head/tests/sys/opencrypto/cryptodev.py	Sat Apr 20 07:32:29 2019	(r346431)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/local/bin/python2
 #
 # Copyright (c) 2014 The FreeBSD Foundation
 # Copyright 2014 John-Mark Gurney

Modified: head/tests/sys/opencrypto/cryptotest.py
==============================================================================
--- head/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 05:31:56 2019	(r346430)
+++ head/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 07:32:29 2019	(r346431)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/local/bin/python2
 #
 # Copyright (c) 2014 The FreeBSD Foundation
 # All rights reserved.

Modified: head/tests/sys/opencrypto/runtests.sh
==============================================================================
--- head/tests/sys/opencrypto/runtests.sh	Sat Apr 20 05:31:56 2019	(r346430)
+++ head/tests/sys/opencrypto/runtests.sh	Sat Apr 20 07:32:29 2019	(r346431)
@@ -61,6 +61,6 @@ done
 oldcdas=$(sysctl -e kern.cryptodevallowsoft)
 sysctl kern.cryptodevallowsoft=1
 
-python $(dirname $0)/cryptotest.py
+python2 $(dirname $0)/cryptotest.py
 
 sysctl "$oldcdas"

From owner-svn-src-head@freebsd.org  Sat Apr 20 11:34:54 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B9FD158B201;
 Sat, 20 Apr 2019 11:34:54 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 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 3FA158DCC4;
 Sat, 20 Apr 2019 11:34:54 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AAF7D857;
 Sat, 20 Apr 2019 11:34:54 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KBYrDA006669;
 Sat, 20 Apr 2019 11:34:53 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KBYroC006668;
 Sat, 20 Apr 2019 11:34:53 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201904201134.x3KBYroC006668@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
 markj@FreeBSD.org using -f
From: Mark Johnston 
Date: Sat, 20 Apr 2019 11:34:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346440 - head/sys/modules/opensolaris
X-SVN-Group: head
X-SVN-Commit-Author: markj
X-SVN-Commit-Paths: head/sys/modules/opensolaris
X-SVN-Commit-Revision: 346440
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 3FA158DCC4
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.96)[-0.965,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, 20 Apr 2019 11:34:54 -0000

Author: markj
Date: Sat Apr 20 11:34:53 2019
New Revision: 346440
URL: https://svnweb.freebsd.org/changeset/base/346440

Log:
  Export cpu_core from opensolaris.ko.
  
  It is referenced by dtrace*.ko.
  
  PR:		191462
  Submitted by:	me.freebsd@cgf.cx
  MFC after:	1 week

Modified:
  head/sys/modules/opensolaris/Makefile

Modified: head/sys/modules/opensolaris/Makefile
==============================================================================
--- head/sys/modules/opensolaris/Makefile	Sat Apr 20 11:05:56 2019	(r346439)
+++ head/sys/modules/opensolaris/Makefile	Sat Apr 20 11:34:53 2019	(r346440)
@@ -27,6 +27,8 @@ CFLAGS+=	-I${SYSDIR}/cddl/compat/opensolaris		\
 		-I${SYSDIR}/cddl/contrib/opensolaris/uts/common	\
 		-I${SYSDIR}
 
+EXPORT_SYMS=	cpu_core
+
 IGNORE_PRAGMA=	1
 
 .include 

From owner-svn-src-head@freebsd.org  Sat Apr 20 12:51:07 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 439DD158D42C;
 Sat, 20 Apr 2019 12:51:07 +0000 (UTC)
 (envelope-from asomers@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.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 DC04890145;
 Sat, 20 Apr 2019 12:51:06 +0000 (UTC)
 (envelope-from asomers@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2BE5E449;
 Sat, 20 Apr 2019 12:51:06 +0000 (UTC)
 (envelope-from asomers@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KCp6fU044900;
 Sat, 20 Apr 2019 12:51:06 GMT (envelope-from asomers@FreeBSD.org)
Received: (from asomers@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KCp6it044898;
 Sat, 20 Apr 2019 12:51:06 GMT (envelope-from asomers@FreeBSD.org)
Message-Id: <201904201251.x3KCp6it044898@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: asomers set sender to
 asomers@FreeBSD.org using -f
From: Alan Somers 
Date: Sat, 20 Apr 2019 12:51:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346441 - in head/sys/modules: em fusefs iavf
X-SVN-Group: head
X-SVN-Commit-Author: asomers
X-SVN-Commit-Paths: in head/sys/modules: em fusefs iavf
X-SVN-Commit-Revision: 346441
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: DC04890145
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.985,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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: Sat, 20 Apr 2019 12:51:07 -0000

Author: asomers
Date: Sat Apr 20 12:51:05 2019
New Revision: 346441
URL: https://svnweb.freebsd.org/changeset/base/346441

Log:
  Use symlinks for kernel modules rather than hardlinks
  
  When aliasing a kernel module to a different name (ie if_igb for if_em),
  it's better to use symlinks than hard links. kldxref will omit entries for
  the links, ensuring that the loaded module has the correct name.
  
  Reviewed by:	imp
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D19979

Modified:
  head/sys/modules/em/Makefile
  head/sys/modules/fusefs/Makefile
  head/sys/modules/iavf/Makefile

Modified: head/sys/modules/em/Makefile
==============================================================================
--- head/sys/modules/em/Makefile	Sat Apr 20 11:34:53 2019	(r346440)
+++ head/sys/modules/em/Makefile	Sat Apr 20 12:51:05 2019	(r346441)
@@ -22,6 +22,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000
 # DEVICE_POLLING for a non-interrupt-driven method
 #CFLAGS  += -DDEVICE_POLLING
 
-LINKS=	${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko
+SYMLINKS=	${KMOD}.ko ${KMODDIR}/if_igb.ko
 
 .include 

Modified: head/sys/modules/fusefs/Makefile
==============================================================================
--- head/sys/modules/fusefs/Makefile	Sat Apr 20 11:34:53 2019	(r346440)
+++ head/sys/modules/fusefs/Makefile	Sat Apr 20 12:51:05 2019	(r346441)
@@ -8,6 +8,6 @@ SRCS=	vnode_if.h \
 	fuse_vfsops.c fuse_vnops.c fuse_internal.c fuse_main.c
 
 # Symlink for backwards compatibility with systems installed at 12.0 or older
-LINKS=	${KMODDIR}/${KMOD}.ko ${KMODDIR}/fuse.ko
+SYMLINKS=	${KMOD}.ko ${KMODDIR}/fuse.ko
 
 .include 

Modified: head/sys/modules/iavf/Makefile
==============================================================================
--- head/sys/modules/iavf/Makefile	Sat Apr 20 11:34:53 2019	(r346440)
+++ head/sys/modules/iavf/Makefile	Sat Apr 20 12:51:05 2019	(r346441)
@@ -15,6 +15,6 @@ SRCS    += i40e_common.c i40e_nvm.c i40e_adminq.c
 # Enable asserts and other debugging facilities
 # CFLAGS += -DINVARIANTS -DINVARIANTS_SUPPORT -DWITNESS
 
-LINKS=	${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_ixlv.ko
+SYMLINKS=	${KMOD}.ko ${KMODDIR}/if_ixlv.ko
 
 .include 

From owner-svn-src-head@freebsd.org  Sat Apr 20 12:57:59 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9300E158D6BF;
 Sat, 20 Apr 2019 12:57:59 +0000 (UTC)
 (envelope-from chmeeedalf@gmail.com)
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [IPv6:2a00:1450:4864:20::22a])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E562490535;
 Sat, 20 Apr 2019 12:57:58 +0000 (UTC)
 (envelope-from chmeeedalf@gmail.com)
Received: by mail-lj1-x22a.google.com with SMTP id t4so6694699ljc.2;
 Sat, 20 Apr 2019 05:57:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=FtmbarH47SJWvM6BmazwjJ5l8MR9rX8Ik6PDo0RbBPQ=;
 b=Ozuq7NADX3o8Dqnvk3wrwv2kh/GYbO/zX0bI8/0sIck+2C9CBVfyZsXBOhoaE2FWts
 tVF7pyjn8HWK5qe00I4pb0M/Cx9mzM1LhxLOrleWUJsflBc+pPl7QPDz3ZOwB5ylZjsS
 LtyMjq2PUAgJcJ6NtgWleV1LlavpYph1ySvVxzO7dlECU2Ia4g6cYvBlja5dGtLTlgEV
 A43VARN12ENxwa0DjPBQLRUSB8fW1tJpSlZdLsmcTXfYTj6hbjpllLROBygmXHHvbj6m
 gx9zRSaecWIZoKhPU6djhxDyezeDFn2KbEPES0YaZr1KY9CgeeifWBPIRVlsYWIiX6+q
 8Ahg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=FtmbarH47SJWvM6BmazwjJ5l8MR9rX8Ik6PDo0RbBPQ=;
 b=pThQlX7rX5oxy9/bxBL9o4rg/UpiylNlgzLWSfD5B5KLINtd+bZFnXx1Oi7DQ3xhL1
 a5PjDLBFOhfK0iISivc4IvbpXpWcJqI47HKU2DjPTOD85UB+cMatBueoCCIqcJLtjCPr
 1oYc6KXbsPrLZQzmt85fQWTLoFOvjAQao7UwqqdcuqJFrYl/9ve5/RXUYP6Wh/GGUc/v
 IPqRDy9quMpxQ7gJ4eYHyhOjjK5upGEPknkH735mSLqX1BFW6HT02cyDz82XeQw/irk8
 SJiUIXix13QOM+Uz/zeL2mejrWvtafooNHkrf5cHMR577RLhvf3ZK0h/KofqMrGyrnU7
 WmSw==
X-Gm-Message-State: APjAAAWKPwsHx4r435EHAKjXVCIGVktJiNCqlcRMUud6Sk3RAbU4tC9L
 rXYt69PEUS2DUZWQVsPUBU/JJblPqB5Lwp4RuO803Q==
X-Google-Smtp-Source: APXvYqzho1aQjiD55p8b02iEZUMWaK2ziUolq3Hv3rxKQxcCGcorlndpV4DLGREBtkiJksTgNtR+B9Nfgl22uUMwmqs=
X-Received: by 2002:a2e:9348:: with SMTP id m8mr5186305ljh.23.1555765075777;
 Sat, 20 Apr 2019 05:57:55 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
In-Reply-To: <201904201251.x3KCp6it044898@repo.freebsd.org>
From: Justin Hibbits 
Date: Sat, 20 Apr 2019 07:57:44 -0500
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Alan Somers 
Cc: src-committers ,
 svn-src-all , svn-src-head@freebsd.org
X-Rspamd-Queue-Id: E562490535
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.98 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[];
 NEURAL_HAM_SHORT(-0.98)[-0.983,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: Sat, 20 Apr 2019 12:57:59 -0000

On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:

> Author: asomers
> Date: Sat Apr 20 12:51:05 2019
> New Revision: 346441
> URL: https://svnweb.freebsd.org/changeset/base/346441
>
> Log:
>   Use symlinks for kernel modules rather than hardlinks
>
>   When aliasing a kernel module to a different name (ie if_igb for if_em),
>   it's better to use symlinks than hard links. kldxref will omit entries
> for
>   the links, ensuring that the loaded module has the correct name.
>
>


Thanks! This should fix installkernel on my POWER9.

- Justin

>
>

From owner-svn-src-head@freebsd.org  Sat Apr 20 13:23:50 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778FA158DE6C;
 Sat, 20 Apr 2019 13:23:50 +0000 (UTC)
 (envelope-from chmeeedalf@gmail.com)
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [IPv6:2a00:1450:4864:20::232])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 028C69114A;
 Sat, 20 Apr 2019 13:23:49 +0000 (UTC)
 (envelope-from chmeeedalf@gmail.com)
Received: by mail-lj1-x232.google.com with SMTP id l7so6737619ljg.6;
 Sat, 20 Apr 2019 06:23:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=OS6ze9oYRde0D2mDt4ZcAb/WZABZWtPWIix75g+U0fQ=;
 b=gL8RVA15KnYNiutU+hEEcorn2W+O8sdCpW4U8HzSKg8k7PWaqJeEzFrgLQ2f2Dg3KO
 +o5UHhGgxEB8/FG9+RYZQgCicCt8dYtvDChkunI3uVCe2Z6WTHQC2DWm91F/XmYGi2Sy
 pfXW6DTC0yHAkt88VH0Pxpj4QrFeIhZZMnVw+cDTh37xs3L27fZTTnhdTzdAKPIm0kvR
 0qKEAyU8lCZKbgnI4pnqKBW7DfY8+098/PddT3FkFSOWRSOyB1DxUQcHgIFI0K4+dzKX
 bYCYglnnrB3p7osadukGPEaIQKGnkngHGxInbcs4bFlvmjxLZzvXY9h0QTH1/BRb2Hwm
 Sp6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=OS6ze9oYRde0D2mDt4ZcAb/WZABZWtPWIix75g+U0fQ=;
 b=eW251VbrWPWsJWRHAfcIlPb52kxnZ/9bDKIdAM4saKB/VbSaNE74QZ9+iixstjTMoE
 JNGW5ubrOTC157QWUm+WaXnWNMtKhGUUo57ZAhMzfjX8cZMhOFHk0tB65Gov7yVYlanm
 IrpeKOTjiroK6Jvi18GanL2fibsDhygir7ImTapWunT7dxki9Qao9XZAAx5XY4IBgq60
 mft7E1lPs7pcJMzgAI5qZWHClWfv9/QfU1bFS7OMm61o4LDUf0lPWm/6e/htY4BArOUO
 HpbZw+0hzgqPnsSSE4cCglF/aYJ6wNch30nqh4b78eOtcM07S8izuGWKJEcOqAuIX/WQ
 nMgw==
X-Gm-Message-State: APjAAAW8YUfdhEArMcD82m548xi90RzH3gN/zfJzwY8lhNg9lbR6tRB4
 +xCJQgXV4+wFbUSEEoKO/f5aWum676z/u/eBsP7PkQ==
X-Google-Smtp-Source: APXvYqwLcQq0NSxM03QWMkfpui2n7z61O2pvSjcxa/G8gXFTLn8NDOFazWYZambnIRfeZWDUvPWHpJgSv0Cp/7evYIQ=
X-Received: by 2002:a2e:9348:: with SMTP id m8mr5237022ljh.23.1555766626965;
 Sat, 20 Apr 2019 06:23:46 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
In-Reply-To: 
From: Justin Hibbits 
Date: Sat, 20 Apr 2019 08:23:35 -0500
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Alan Somers 
Cc: src-committers ,
 svn-src-all , 
 svn-src-head 
X-Rspamd-Queue-Id: 028C69114A
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org;
 dkim=pass header.d=gmail.com header.s=20161025 header.b=gL8RVA15;
 dmarc=pass (policy=none) header.from=gmail.com;
 spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates
 2a00:1450:4864:20::232 as permitted sender)
 smtp.mailfrom=chmeeedalf@gmail.com
X-Spamd-Result: default: False [-6.79 / 15.00]; ARC_NA(0.00)[];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[];
 RCPT_COUNT_THREE(0.00)[4];
 R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36];
 FREEMAIL_FROM(0.00)[gmail.com];
 MIME_GOOD(-0.10)[multipart/alternative,text/plain];
 TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0];
 RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[];
 DKIM_TRACE(0.00)[gmail.com:+];
 DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
 RCVD_IN_DNSWL_NONE(0.00)[2.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org
 : 127.0.5.0]; 
 MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com];
 IP_SCORE(-2.79)[ip: (-9.24), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-2.26),
 country: US(-0.06)]; NEURAL_HAM_SHORT(-0.99)[-0.989,0];
 FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+];
 FREEMAIL_ENVFROM(0.00)[gmail.com];
 ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US];
 RCVD_COUNT_TWO(0.00)[2];
 DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.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: Sat, 20 Apr 2019 13:23:50 -0000

On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:

> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> wrote:
> >
> >
> >
> > On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> >>
> >> Author: asomers
> >> Date: Sat Apr 20 12:51:05 2019
> >> New Revision: 346441
> >> URL: https://svnweb.freebsd.org/changeset/base/346441
> >>
> >> Log:
> >>   Use symlinks for kernel modules rather than hardlinks
> >>
> >>   When aliasing a kernel module to a different name (ie if_igb for
> if_em),
> >>   it's better to use symlinks than hard links. kldxref will omit
> entries for
> >>   the links, ensuring that the loaded module has the correct name.
> >>
> >>
> >
> >
> > Thanks! This should fix installkernel on my POWER9.
> >
> > - Justin
>
> What's the problem with your POWER9?  Is that one of those msdosfs
> /boot systems?  If so, I don't think this will fix it.  msdosfs
> doesn't support either symlinks or hardlinks.  Or is there some other
> problem?
> -Alan
>

Yes it is.  Well that's a bummer then. I thought we faked symlinks on
msdosfs, but on second thought not sure how well would do that.

- Justin

>

From owner-svn-src-head@freebsd.org  Sat Apr 20 13:46:58 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AE13158E745;
 Sat, 20 Apr 2019 13:46:58 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com
 [209.85.208.195])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CD74E91C7E;
 Sat, 20 Apr 2019 13:46:57 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: by mail-lj1-f195.google.com with SMTP id v22so6737870lje.9;
 Sat, 20 Apr 2019 06:46:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=Vp2yGWWjgC9e5YSIjEMA85cdmgBTGdRL9JCvKeMLHGg=;
 b=HF9O5FGB+F/LasmEuSv2IQHQKODNHdOKPAYDrjuwVMBatQdPb+6aokmuyGhJztV0Gu
 VZJujwgTITbTqYiW/Tdh+CQ1BuuyjcUEQbS3hTXbVIN45xUrgr4e5ZHEWiMEzyu9MmfU
 HBnI60fx3W6MNF8dA9ig0kcx4KwR22vsTIzK8S7MRH3Bc1QNCE6Fi3CRlOqKUdOc04k2
 b/Cz4wgr6KI5gA0rCFmA2Xb/9J5QO8n4wwmW8Iulr2ujEs3Cu20nTS1uzB62gqKvTM3G
 why0b9xYb9SCKPB9VXO5I6iLBE7LPw5KJQETJCjuv40ui29M8Teq1alpuD1a/KyvMl+H
 urZw==
X-Gm-Message-State: APjAAAWP+RHjiqolXFoQWylclgvrTh/sTX8Z4cSEZMfdciEJyb+h6Z0L
 27RfWDAZsVXOVPmKsGOzkkWXbLztimQjgniraFpOvzUS
X-Google-Smtp-Source: APXvYqwEBe5kRU97ZQGEtDLuMWFHGAmuHV0y+/91lTufLeWHMg1TxSD0xhveknKEZ0NeEIh/Bv8GgStNMiKCMGAxI3s=
X-Received: by 2002:a2e:9719:: with SMTP id r25mr4657397lji.29.1555768015730; 
 Sat, 20 Apr 2019 06:46:55 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
 
In-Reply-To: 
From: Alan Somers 
Date: Sat, 20 Apr 2019 07:46:44 -0600
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Justin Hibbits 
Cc: src-committers ,
 svn-src-all , 
 svn-src-head 
Content-Type: text/plain; charset="UTF-8"
X-Rspamd-Queue-Id: CD74E91C7E
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.89 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 NEURAL_HAM_SHORT(-0.89)[-0.894,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: Sat, 20 Apr 2019 13:46:58 -0000

On Sat, Apr 20, 2019 at 7:23 AM Justin Hibbits  wrote:
>
>
>
> On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
>>
>> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits  wrote:
>> >
>> >
>> >
>> > On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
>> >>
>> >> Author: asomers
>> >> Date: Sat Apr 20 12:51:05 2019
>> >> New Revision: 346441
>> >> URL: https://svnweb.freebsd.org/changeset/base/346441
>> >>
>> >> Log:
>> >>   Use symlinks for kernel modules rather than hardlinks
>> >>
>> >>   When aliasing a kernel module to a different name (ie if_igb for if_em),
>> >>   it's better to use symlinks than hard links. kldxref will omit entries for
>> >>   the links, ensuring that the loaded module has the correct name.
>> >>
>> >>
>> >
>> >
>> > Thanks! This should fix installkernel on my POWER9.
>> >
>> > - Justin
>>
>> What's the problem with your POWER9?  Is that one of those msdosfs
>> /boot systems?  If so, I don't think this will fix it.  msdosfs
>> doesn't support either symlinks or hardlinks.  Or is there some other
>> problem?
>> -Alan
>
>
> Yes it is.  Well that's a bummer then. I thought we faked symlinks on msdosfs, but on second thought not sure how well would do that.
>
> - Justin

We should probably just remove the offending links on ppc, then.  The
only harm is that after upgrading, ppc users would have to replace
fuse_load="YES" with fusefs_load="YES".
-Alan

From owner-svn-src-head@freebsd.org  Sat Apr 20 13:54:05 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D105E158E971;
 Sat, 20 Apr 2019 13:54:05 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com
 [209.85.208.181])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5CA10920C1;
 Sat, 20 Apr 2019 13:54:05 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: by mail-lj1-f181.google.com with SMTP id k8so6755339lja.8;
 Sat, 20 Apr 2019 06:54:05 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=31YLO0Kc7ytFbYRfrMgC6bw2WAYRkSRAwVIWS7UwwdM=;
 b=q+JLo9vpGfubW7Yl4ETPd4WJuQuuggwNqSjgMD35IlwON6gPiBDxeqQVvhLCRiVrjh
 2D2386oyGwXCQYj7F+40xLZI26Lx2wB2GtWHDjLrlRDnxcz8vELFm1fPkN3hu+2YICIj
 zKtoTwZl0/WLdcFQCDUOIamdYi3zatvv2h17ColAH//key4P7w9A+jvVBnsCZ+IdK0Gi
 7Xo1b57r0jS10e/9cCugVS+U9iLNv43sw9Vt6URJw5B/MeAs0yhZQhCKh9Ly3fTpLOH9
 48I4JRYiEjuuGaG4PSiayvdi9QGKp8DhNnlDUE3aVz2gmUTRw9LU999wPZCeMrUbdPDC
 siNA==
X-Gm-Message-State: APjAAAVtX2958uVkCIrh7Sp06Yo4U3YQX1D2AYTgQuiaEE4rijZs7sXQ
 e53NASMyIw20P6a3RFmIQmiqyUO4EF0EWaCT1Q2G7d2i
X-Google-Smtp-Source: APXvYqwuC6SBJbucfn7PoD111RAu3RvsAYquKTJzHFLs0Aa32Sx62vv/CN1tRE5TIwWGUk4a/LAm8zFXTwxNgyL5YZk=
X-Received: by 2002:a2e:9703:: with SMTP id r3mr4981998lji.88.1555766502377;
 Sat, 20 Apr 2019 06:21:42 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
In-Reply-To: 
From: Alan Somers 
Date: Sat, 20 Apr 2019 07:21:30 -0600
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Justin Hibbits 
Cc: src-committers ,
 svn-src-all , 
 svn-src-head 
Content-Type: text/plain; charset="UTF-8"
X-Rspamd-Queue-Id: 5CA10920C1
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.89 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[];
 NEURAL_HAM_SHORT(-0.89)[-0.894,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, 20 Apr 2019 13:54:06 -0000

On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits  wrote:
>
>
>
> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
>>
>> Author: asomers
>> Date: Sat Apr 20 12:51:05 2019
>> New Revision: 346441
>> URL: https://svnweb.freebsd.org/changeset/base/346441
>>
>> Log:
>>   Use symlinks for kernel modules rather than hardlinks
>>
>>   When aliasing a kernel module to a different name (ie if_igb for if_em),
>>   it's better to use symlinks than hard links. kldxref will omit entries for
>>   the links, ensuring that the loaded module has the correct name.
>>
>>
>
>
> Thanks! This should fix installkernel on my POWER9.
>
> - Justin

What's the problem with your POWER9?  Is that one of those msdosfs
/boot systems?  If so, I don't think this will fix it.  msdosfs
doesn't support either symlinks or hardlinks.  Or is there some other
problem?
-Alan

From owner-svn-src-head@freebsd.org  Sat Apr 20 15:15:37 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A9B159009D
 for ;
 Sat, 20 Apr 2019 15:15:37 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com
 [IPv6:2607:f8b0:4864:20::842])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 25A589457D
 for ; Sat, 20 Apr 2019 15:15:37 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: by mail-qt1-x842.google.com with SMTP id s15so8165280qtn.3
 for ; Sat, 20 Apr 2019 08:15:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=bsdimp-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=HP5QqCrxgO/rEElo0iDGfWOcNg1kojxwJrv/Z2BRzvg=;
 b=GxsH4NFQrPzmt/3Np2V7xnRV5ofhpIqjiVLOyEZxoHKH7zFk1Cn3VU6Tf18sFgJG2s
 A2K+6ZzJpTMwbYO5sNhAJm8JZK/p+TP7/J6P1ZbZwA1JjD9SfwwFs9DLN0AjvyDw/OkR
 1WlR/1fE+rWUlS1jY6cXYm1oO18j+YuKfVGJz64eqYoy13v8sz4D2jPT2TzXOSqkK6Ar
 6oQYzLTO0lmmW2N3AR6O1mP1QPP19AnqZPbHdbe1kUOE79aKDQmEx5uUgRAIxS6M/cgz
 ZcsHI8g178PBV5mpohD5xENfO5mtLrroHFaenT92T17l45jVTs1GwZsy8RcCeat+M443
 Nfjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=HP5QqCrxgO/rEElo0iDGfWOcNg1kojxwJrv/Z2BRzvg=;
 b=lzsiAC5T+DmFi25KOjifHFRh8DqUFd09tFoznbMhHDA4apecCMVb39Y+Q2CjSbxjI4
 36vFsApR9xMW8shMVGZGQToeSAnngxR16czpWyxbseCbLE+HiL0UZq8Leao7eYlaU0yG
 DJikp+8gUc/G2Q4kpT2kYzc2b9gjjp5XF5fQfy+wz58ijhCgI7qCdY2GZjVDklUDYw10
 9VoXH25EPg3I5QHHWQ8e+lQb5bOny/CyjYngHeZJtMSuTnG8WiExtn2yKk3OsrK2+cLm
 ZmLyol500LtOpf4NPbfLeqeeC1ZgJEafKth+HxSjkcBn8ofvjfeBT2rBM3lyvME/lnqa
 rq6w==
X-Gm-Message-State: APjAAAUodov6LReEq1BpOSEYxwcECbEWnMInnYbnZrnrTL8koE/HPUJ1
 n2fFOl9etTiLAeoVxflpkQUR1kOl1x+w3g9JmGOuZg==
X-Google-Smtp-Source: APXvYqxeFpYHxxzNBSMlemNLAo/yjYvyqZM0YeHvXAqEY46ehWqMeD2bJ2aFf+vmNT/+56oJXW1CRILhs7JeZEXh7/c=
X-Received: by 2002:ac8:4685:: with SMTP id g5mr7979301qto.242.1555773335777; 
 Sat, 20 Apr 2019 08:15:35 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
 
 
In-Reply-To: 
From: Warner Losh 
Date: Sat, 20 Apr 2019 09:15:23 -0600
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Alan Somers 
Cc: Justin Hibbits ,
 src-committers , 
 svn-src-all , svn-src-head 
X-Rspamd-Queue-Id: 25A589457D
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.960,0]; REPLY(-4.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,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: Sat, 20 Apr 2019 15:15:37 -0000

On Sat, Apr 20, 2019, 7:47 AM Alan Somers  wrote:

> On Sat, Apr 20, 2019 at 7:23 AM Justin Hibbits 
> wrote:
> >
> >
> >
> > On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> >>
> >> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> wrote:
> >> >
> >> >
> >> >
> >> > On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> >> >>
> >> >> Author: asomers
> >> >> Date: Sat Apr 20 12:51:05 2019
> >> >> New Revision: 346441
> >> >> URL: https://svnweb.freebsd.org/changeset/base/346441
> >> >>
> >> >> Log:
> >> >>   Use symlinks for kernel modules rather than hardlinks
> >> >>
> >> >>   When aliasing a kernel module to a different name (ie if_igb for
> if_em),
> >> >>   it's better to use symlinks than hard links. kldxref will omit
> entries for
> >> >>   the links, ensuring that the loaded module has the correct name.
> >> >>
> >> >>
> >> >
> >> >
> >> > Thanks! This should fix installkernel on my POWER9.
> >> >
> >> > - Justin
> >>
> >> What's the problem with your POWER9?  Is that one of those msdosfs
> >> /boot systems?  If so, I don't think this will fix it.  msdosfs
> >> doesn't support either symlinks or hardlinks.  Or is there some other
> >> problem?
> >> -Alan
> >
> >
> > Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> msdosfs, but on second thought not sure how well would do that.
> >
> > - Justin
>
> We should probably just remove the offending links on ppc, then.  The
> only harm is that after upgrading, ppc users would have to replace
> fuse_load="YES" with fusefs_load="YES".
>

We should only do the Intel links on those platforms that have legacy users
that need the old names. We should also only support the old names for one
release or so.

Warner

>

From owner-svn-src-head@freebsd.org  Sat Apr 20 15:43:29 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 444571590B1F;
 Sat, 20 Apr 2019 15:43:29 +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 D1E5B9577A;
 Sat, 20 Apr 2019 15:43:28 +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 BFD7618315;
 Sat, 20 Apr 2019 15:43:28 +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 x3KFhSQh037970;
 Sat, 20 Apr 2019 15:43:28 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KFhSAl037969;
 Sat, 20 Apr 2019 15:43:28 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201904201543.x3KFhSAl037969@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Enji Cooper 
Date: Sat, 20 Apr 2019 15:43:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346443 - head/tests/sys/opencrypto
X-SVN-Group: head
X-SVN-Commit-Author: ngie
X-SVN-Commit-Paths: head/tests/sys/opencrypto
X-SVN-Commit-Revision: 346443
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: D1E5B9577A
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.978,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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: Sat, 20 Apr 2019 15:43:29 -0000

Author: ngie
Date: Sat Apr 20 15:43:28 2019
New Revision: 346443
URL: https://svnweb.freebsd.org/changeset/base/346443

Log:
  tests/sys/opencrypto: fix whitespace per PEP8
  
  Replace hard tabs with four-character indentations, per PEP8.
  
  This is being done to separate stylistic changes from the tests from functional
  ones, as I accidentally introduced a bug to the tests when I used four-space
  indentation locally.
  
  No functional change.
  
  MFC after:	2 months
  Approved by:	emaste (mentor: implicit blanket approval for trivial fixes)

Modified:
  head/tests/sys/opencrypto/cryptodev.py
  head/tests/sys/opencrypto/cryptotest.py

Modified: head/tests/sys/opencrypto/cryptodev.py
==============================================================================
--- head/tests/sys/opencrypto/cryptodev.py	Sat Apr 20 15:06:58 2019	(r346442)
+++ head/tests/sys/opencrypto/cryptodev.py	Sat Apr 20 15:43:28 2019	(r346443)
@@ -43,65 +43,65 @@ from cryptodevh import *
 __all__ = [ 'Crypto', 'MismatchError', ]
 
 class FindOp(dpkt.Packet):
-	__byte_order__ = '@'
-	__hdr__ = ( ('crid', 'i', 0),
-		('name', '32s', 0),
-	)
+    __byte_order__ = '@'
+    __hdr__ = ( ('crid', 'i', 0),
+        ('name', '32s', 0),
+    )
 
 class SessionOp(dpkt.Packet):
-	__byte_order__ = '@'
-	__hdr__ = ( ('cipher', 'I', 0),
-		('mac', 'I', 0),
-		('keylen', 'I', 0),
-		('key', 'P', 0),
-		('mackeylen', 'i', 0),
-		('mackey', 'P', 0),
-		('ses', 'I', 0),
-	)
+    __byte_order__ = '@'
+    __hdr__ = ( ('cipher', 'I', 0),
+        ('mac', 'I', 0),
+        ('keylen', 'I', 0),
+        ('key', 'P', 0),
+        ('mackeylen', 'i', 0),
+        ('mackey', 'P', 0),
+        ('ses', 'I', 0),
+    )
 
 class SessionOp2(dpkt.Packet):
-	__byte_order__ = '@'
-	__hdr__ = ( ('cipher', 'I', 0),
-		('mac', 'I', 0),
-		('keylen', 'I', 0),
-		('key', 'P', 0),
-		('mackeylen', 'i', 0),
-		('mackey', 'P', 0),
-		('ses', 'I', 0),
-		('crid', 'i', 0),
-		('pad0', 'i', 0),
-		('pad1', 'i', 0),
-		('pad2', 'i', 0),
-		('pad3', 'i', 0),
-	)
+    __byte_order__ = '@'
+    __hdr__ = ( ('cipher', 'I', 0),
+        ('mac', 'I', 0),
+        ('keylen', 'I', 0),
+        ('key', 'P', 0),
+        ('mackeylen', 'i', 0),
+        ('mackey', 'P', 0),
+        ('ses', 'I', 0),
+        ('crid', 'i', 0),
+        ('pad0', 'i', 0),
+        ('pad1', 'i', 0),
+        ('pad2', 'i', 0),
+        ('pad3', 'i', 0),
+    )
 
 class CryptOp(dpkt.Packet):
-	__byte_order__ = '@'
-	__hdr__ = ( ('ses', 'I', 0),
-		('op', 'H', 0),
-		('flags', 'H', 0),
-		('len', 'I', 0),
-		('src', 'P', 0),
-		('dst', 'P', 0),
-		('mac', 'P', 0),
-		('iv', 'P', 0),
-	)
+    __byte_order__ = '@'
+    __hdr__ = ( ('ses', 'I', 0),
+        ('op', 'H', 0),
+        ('flags', 'H', 0),
+        ('len', 'I', 0),
+        ('src', 'P', 0),
+        ('dst', 'P', 0),
+        ('mac', 'P', 0),
+        ('iv', 'P', 0),
+    )
 
 class CryptAEAD(dpkt.Packet):
-	__byte_order__ = '@'
-	__hdr__ = (
-		('ses',		'I', 0),
-		('op',		'H', 0),
-		('flags',	'H', 0),
-		('len',		'I', 0),
-		('aadlen',	'I', 0),
-		('ivlen',	'I', 0),
-		('src',		'P', 0),
-		('dst',		'P', 0),
-		('aad',		'P', 0),
-		('tag',		'P', 0),
-		('iv',		'P', 0),
-	)
+    __byte_order__ = '@'
+    __hdr__ = (
+        ('ses',        'I', 0),
+        ('op',        'H', 0),
+        ('flags',    'H', 0),
+        ('len',        'I', 0),
+        ('aadlen',    'I', 0),
+        ('ivlen',    'I', 0),
+        ('src',        'P', 0),
+        ('dst',        'P', 0),
+        ('aad',        'P', 0),
+        ('tag',        'P', 0),
+        ('iv',        'P', 0),
+    )
 
 # h2py.py can't handle multiarg macros
 CRIOGET = 3221513060
@@ -116,445 +116,445 @@ CIOCFINDDEV = 3223610220
 CIOCCRYPTAEAD = 3225445229
 
 def _getdev():
-	fd = os.open('/dev/crypto', os.O_RDWR)
-	buf = array.array('I', [0])
-	ioctl(fd, CRIOGET, buf, 1)
-	os.close(fd)
+    fd = os.open('/dev/crypto', os.O_RDWR)
+    buf = array.array('I', [0])
+    ioctl(fd, CRIOGET, buf, 1)
+    os.close(fd)
 
-	return buf[0]
+    return buf[0]
 
 _cryptodev = _getdev()
 
 def _findop(crid, name):
-	fop = FindOp()
-	fop.crid = crid
-	fop.name = name
-	s = array.array('B', fop.pack_hdr())
-	ioctl(_cryptodev, CIOCFINDDEV, s, 1)
-	fop.unpack(s)
+    fop = FindOp()
+    fop.crid = crid
+    fop.name = name
+    s = array.array('B', fop.pack_hdr())
+    ioctl(_cryptodev, CIOCFINDDEV, s, 1)
+    fop.unpack(s)
 
-	try:
-		idx = fop.name.index('\x00')
-		name = fop.name[:idx]
-	except ValueError:
-		name = fop.name
+    try:
+        idx = fop.name.index('\x00')
+        name = fop.name[:idx]
+    except ValueError:
+        name = fop.name
 
-	return fop.crid, name
+    return fop.crid, name
 
 class Crypto:
-	@staticmethod
-	def findcrid(name):
-		return _findop(-1, name)[0]
+    @staticmethod
+    def findcrid(name):
+        return _findop(-1, name)[0]
 
-	@staticmethod
-	def getcridname(crid):
-		return _findop(crid, '')[1]
+    @staticmethod
+    def getcridname(crid):
+        return _findop(crid, '')[1]
 
-	def __init__(self, cipher=0, key=None, mac=0, mackey=None,
-	    crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE):
-		self._ses = None
-		ses = SessionOp2()
-		ses.cipher = cipher
-		ses.mac = mac
+    def __init__(self, cipher=0, key=None, mac=0, mackey=None,
+        crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE):
+        self._ses = None
+        ses = SessionOp2()
+        ses.cipher = cipher
+        ses.mac = mac
 
-		if key is not None:
-			ses.keylen = len(key)
-			k = array.array('B', key)
-			ses.key = k.buffer_info()[0]
-		else:
-			self.key = None
+        if key is not None:
+            ses.keylen = len(key)
+            k = array.array('B', key)
+            ses.key = k.buffer_info()[0]
+        else:
+            self.key = None
 
-		if mackey is not None:
-			ses.mackeylen = len(mackey)
-			mk = array.array('B', mackey)
-			ses.mackey = mk.buffer_info()[0]
-			self._maclen = 16	# parameterize?
-		else:
-			self._maclen = None
+        if mackey is not None:
+            ses.mackeylen = len(mackey)
+            mk = array.array('B', mackey)
+            ses.mackey = mk.buffer_info()[0]
+            self._maclen = 16    # parameterize?
+        else:
+            self._maclen = None
 
-		if not cipher and not mac:
-			raise ValueError('one of cipher or mac MUST be specified.')
-		ses.crid = crid
-		#print(ses)
-		s = array.array('B', ses.pack_hdr())
-		#print(s)
-		ioctl(_cryptodev, CIOCGSESSION2, s, 1)
-		ses.unpack(s)
+        if not cipher and not mac:
+            raise ValueError('one of cipher or mac MUST be specified.')
+        ses.crid = crid
+        #print(ses)
+        s = array.array('B', ses.pack_hdr())
+        #print(s)
+        ioctl(_cryptodev, CIOCGSESSION2, s, 1)
+        ses.unpack(s)
 
-		self._ses = ses.ses
+        self._ses = ses.ses
 
-	def __del__(self):
-		if self._ses is None:
-			return
+    def __del__(self):
+        if self._ses is None:
+            return
 
-		try:
-			ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses))
-		except TypeError:
-			pass
-		self._ses = None
+        try:
+            ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses))
+        except TypeError:
+            pass
+        self._ses = None
 
-	def _doop(self, op, src, iv):
-		cop = CryptOp()
-		cop.ses = self._ses
-		cop.op = op
-		cop.flags = 0
-		cop.len = len(src)
-		s = array.array('B', src)
-		cop.src = cop.dst = s.buffer_info()[0]
-		if self._maclen is not None:
-			m = array.array('B', [0] * self._maclen)
-			cop.mac = m.buffer_info()[0]
-		ivbuf = array.array('B', iv)
-		cop.iv = ivbuf.buffer_info()[0]
+    def _doop(self, op, src, iv):
+        cop = CryptOp()
+        cop.ses = self._ses
+        cop.op = op
+        cop.flags = 0
+        cop.len = len(src)
+        s = array.array('B', src)
+        cop.src = cop.dst = s.buffer_info()[0]
+        if self._maclen is not None:
+            m = array.array('B', [0] * self._maclen)
+            cop.mac = m.buffer_info()[0]
+        ivbuf = array.array('B', iv)
+        cop.iv = ivbuf.buffer_info()[0]
 
-		#print('cop:', cop)
-		ioctl(_cryptodev, CIOCCRYPT, str(cop))
+        #print('cop:', cop)
+        ioctl(_cryptodev, CIOCCRYPT, str(cop))
 
-		s = s.tostring()
-		if self._maclen is not None:
-			return s, m.tostring()
+        s = s.tostring()
+        if self._maclen is not None:
+            return s, m.tostring()
 
-		return s
+        return s
 
-	def _doaead(self, op, src, aad, iv, tag=None):
-		caead = CryptAEAD()
-		caead.ses = self._ses
-		caead.op = op
-		caead.flags = CRD_F_IV_EXPLICIT
-		caead.flags = 0
-		caead.len = len(src)
-		s = array.array('B', src)
-		caead.src = caead.dst = s.buffer_info()[0]
-		caead.aadlen = len(aad)
-		saad = array.array('B', aad)
-		caead.aad = saad.buffer_info()[0]
+    def _doaead(self, op, src, aad, iv, tag=None):
+        caead = CryptAEAD()
+        caead.ses = self._ses
+        caead.op = op
+        caead.flags = CRD_F_IV_EXPLICIT
+        caead.flags = 0
+        caead.len = len(src)
+        s = array.array('B', src)
+        caead.src = caead.dst = s.buffer_info()[0]
+        caead.aadlen = len(aad)
+        saad = array.array('B', aad)
+        caead.aad = saad.buffer_info()[0]
 
-		if self._maclen is None:
-			raise ValueError('must have a tag length')
+        if self._maclen is None:
+            raise ValueError('must have a tag length')
 
-		if tag is None:
-			tag = array.array('B', [0] * self._maclen)
-		else:
-			assert len(tag) == self._maclen, \
+        if tag is None:
+            tag = array.array('B', [0] * self._maclen)
+        else:
+            assert len(tag) == self._maclen, \
                 '%d != %d' % (len(tag), self._maclen)
-			tag = array.array('B', tag)
+            tag = array.array('B', tag)
 
-		caead.tag = tag.buffer_info()[0]
+        caead.tag = tag.buffer_info()[0]
 
-		ivbuf = array.array('B', iv)
-		caead.ivlen = len(iv)
-		caead.iv = ivbuf.buffer_info()[0]
+        ivbuf = array.array('B', iv)
+        caead.ivlen = len(iv)
+        caead.iv = ivbuf.buffer_info()[0]
 
-		ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead))
+        ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead))
 
-		s = s.tostring()
+        s = s.tostring()
 
-		return s, tag.tostring()
+        return s, tag.tostring()
 
-	def perftest(self, op, size, timeo=3):
-		import random
-		import time
+    def perftest(self, op, size, timeo=3):
+        import random
+        import time
 
-		inp = array.array('B', (random.randint(0, 255) for x in xrange(size)))
-		out = array.array('B', inp)
+        inp = array.array('B', (random.randint(0, 255) for x in xrange(size)))
+        out = array.array('B', inp)
 
-		# prep ioctl
-		cop = CryptOp()
-		cop.ses = self._ses
-		cop.op = op
-		cop.flags = 0
-		cop.len = len(inp)
-		s = array.array('B', inp)
-		cop.src = s.buffer_info()[0]
-		cop.dst = out.buffer_info()[0]
-		if self._maclen is not None:
-			m = array.array('B', [0] * self._maclen)
-			cop.mac = m.buffer_info()[0]
-		ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16)))
-		cop.iv = ivbuf.buffer_info()[0]
+        # prep ioctl
+        cop = CryptOp()
+        cop.ses = self._ses
+        cop.op = op
+        cop.flags = 0
+        cop.len = len(inp)
+        s = array.array('B', inp)
+        cop.src = s.buffer_info()[0]
+        cop.dst = out.buffer_info()[0]
+        if self._maclen is not None:
+            m = array.array('B', [0] * self._maclen)
+            cop.mac = m.buffer_info()[0]
+        ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16)))
+        cop.iv = ivbuf.buffer_info()[0]
 
-		exit = [ False ]
-		def alarmhandle(a, b, exit=exit):
-			exit[0] = True
+        exit = [ False ]
+        def alarmhandle(a, b, exit=exit):
+            exit[0] = True
 
-		oldalarm = signal.signal(signal.SIGALRM, alarmhandle)
-		signal.alarm(timeo)
+        oldalarm = signal.signal(signal.SIGALRM, alarmhandle)
+        signal.alarm(timeo)
 
-		start = time.time()
-		reps = 0
-		while not exit[0]:
-			ioctl(_cryptodev, CIOCCRYPT, str(cop))
-			reps += 1
+        start = time.time()
+        reps = 0
+        while not exit[0]:
+            ioctl(_cryptodev, CIOCCRYPT, str(cop))
+            reps += 1
 
-		end = time.time()
+        end = time.time()
 
-		signal.signal(signal.SIGALRM, oldalarm)
+        signal.signal(signal.SIGALRM, oldalarm)
 
-		print('time:', end - start)
-		print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024)
+        print('time:', end - start)
+        print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024)
 
-	def encrypt(self, data, iv, aad=None):
-		if aad is None:
-			return self._doop(COP_ENCRYPT, data, iv)
-		else:
-			return self._doaead(COP_ENCRYPT, data, aad,
-			    iv)
+    def encrypt(self, data, iv, aad=None):
+        if aad is None:
+            return self._doop(COP_ENCRYPT, data, iv)
+        else:
+            return self._doaead(COP_ENCRYPT, data, aad,
+                iv)
 
-	def decrypt(self, data, iv, aad=None, tag=None):
-		if aad is None:
-			return self._doop(COP_DECRYPT, data, iv)
-		else:
-			return self._doaead(COP_DECRYPT, data, aad,
-			    iv, tag=tag)
+    def decrypt(self, data, iv, aad=None, tag=None):
+        if aad is None:
+            return self._doop(COP_DECRYPT, data, iv)
+        else:
+            return self._doaead(COP_DECRYPT, data, aad,
+                iv, tag=tag)
 
 class MismatchError(Exception):
-	pass
+    pass
 
 class KATParser:
-	def __init__(self, fname, fields):
-		self.fp = open(fname)
-		self.fields = set(fields)
-		self._pending = None
+    def __init__(self, fname, fields):
+        self.fp = open(fname)
+        self.fields = set(fields)
+        self._pending = None
 
-	def __iter__(self):
-		while True:
-			didread = False
-			if self._pending is not None:
-				i = self._pending
-				self._pending = None
-			else:
-				i = self.fp.readline()
-				didread = True
+    def __iter__(self):
+        while True:
+            didread = False
+            if self._pending is not None:
+                i = self._pending
+                self._pending = None
+            else:
+                i = self.fp.readline()
+                didread = True
 
-			if didread and not i:
-				return
+            if didread and not i:
+                return
 
-			if (i and i[0] == '#') or not i.strip():
-				continue
-			if i[0] == '[':
-				yield i[1:].split(']', 1)[0], self.fielditer()
-			else:
-				raise ValueError('unknown line: %r' % repr(i))
+            if (i and i[0] == '#') or not i.strip():
+                continue
+            if i[0] == '[':
+                yield i[1:].split(']', 1)[0], self.fielditer()
+            else:
+                raise ValueError('unknown line: %r' % repr(i))
 
-	def eatblanks(self):
-		while True:
-			line = self.fp.readline()
-			if line == '':
-				break
+    def eatblanks(self):
+        while True:
+            line = self.fp.readline()
+            if line == '':
+                break
 
-			line = line.strip()
-			if line:
-				break
+            line = line.strip()
+            if line:
+                break
 
-		return line
+        return line
 
-	def fielditer(self):
-		while True:
-			values = {}
+    def fielditer(self):
+        while True:
+            values = {}
 
-			line = self.eatblanks()
-			if not line or line[0] == '[':
-				self._pending = line
-				return
+            line = self.eatblanks()
+            if not line or line[0] == '[':
+                self._pending = line
+                return
 
-			while True:
-				try:
-					f, v = line.split(' =')
-				except:
-					if line == 'FAIL':
-						f, v = 'FAIL', ''
-					else:
-						print('line:', repr(line))
-						raise
-				v = v.strip()
+            while True:
+                try:
+                    f, v = line.split(' =')
+                except:
+                    if line == 'FAIL':
+                        f, v = 'FAIL', ''
+                    else:
+                        print('line:', repr(line))
+                        raise
+                v = v.strip()
 
-				if f in values:
-					raise ValueError('already present: %r' % repr(f))
-				values[f] = v
-				line = self.fp.readline().strip()
-				if not line:
-					break
+                if f in values:
+                    raise ValueError('already present: %r' % repr(f))
+                values[f] = v
+                line = self.fp.readline().strip()
+                if not line:
+                    break
 
-			# we should have everything
-			remain = self.fields.copy() - set(values.keys())
-			# XXX - special case GCM decrypt
-			if remain and not ('FAIL' in values and 'PT' in remain):
-				raise ValueError('not all fields found: %r' % repr(remain))
+            # we should have everything
+            remain = self.fields.copy() - set(values.keys())
+            # XXX - special case GCM decrypt
+            if remain and not ('FAIL' in values and 'PT' in remain):
+                raise ValueError('not all fields found: %r' % repr(remain))
 
-			yield values
+            yield values
 
 def _spdechex(s):
-	return ''.join(s.split()).decode('hex')
+    return ''.join(s.split()).decode('hex')
 
 if __name__ == '__main__':
-	if True:
-		try:
-			crid = Crypto.findcrid('aesni0')
-			print('aesni:', crid)
-		except IOError:
-			print('aesni0 not found')
+    if True:
+        try:
+            crid = Crypto.findcrid('aesni0')
+            print('aesni:', crid)
+        except IOError:
+            print('aesni0 not found')
 
-		for i in xrange(10):
-			try:
-				name = Crypto.getcridname(i)
-				print('%2d: %r' % (i, repr(name)))
-			except IOError:
-				pass
-	elif False:
-		kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ])
-		for mode, ni in kp:
-			print(i, ni)
-			for j in ni:
-				print(j)
-	elif False:
-		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-		iv = _spdechex('00000000000000000000000000000001')
-		pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e')
-		#pt = _spdechex('00000000000000000000000000000000')
-		ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef')
+        for i in xrange(10):
+            try:
+                name = Crypto.getcridname(i)
+                print('%2d: %r' % (i, repr(name)))
+            except IOError:
+                pass
+    elif False:
+        kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ])
+        for mode, ni in kp:
+            print(i, ni)
+            for j in ni:
+                print(j)
+    elif False:
+        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+        iv = _spdechex('00000000000000000000000000000001')
+        pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e')
+        #pt = _spdechex('00000000000000000000000000000000')
+        ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef')
 
-		c = Crypto(CRYPTO_AES_ICM, key)
-		enc = c.encrypt(pt, iv)
+        c = Crypto(CRYPTO_AES_ICM, key)
+        enc = c.encrypt(pt, iv)
 
-		print('enc:', enc.encode('hex'))
-		print(' ct:', ct.encode('hex'))
+        print('enc:', enc.encode('hex'))
+        print(' ct:', ct.encode('hex'))
 
-		assert ct == enc
+        assert ct == enc
 
-		dec = c.decrypt(ct, iv)
+        dec = c.decrypt(ct, iv)
 
-		print('dec:', dec.encode('hex'))
-		print(' pt:', pt.encode('hex'))
+        print('dec:', dec.encode('hex'))
+        print(' pt:', pt.encode('hex'))
 
-		assert pt == dec
-	elif False:
-		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-		iv = _spdechex('00000000000000000000000000000001')
-		pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
-		#pt = _spdechex('00000000000000000000000000000000')
-		ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef3768')
+        assert pt == dec
+    elif False:
+        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+        iv = _spdechex('00000000000000000000000000000001')
+        pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
+        #pt = _spdechex('00000000000000000000000000000000')
+        ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef3768')
 
-		c = Crypto(CRYPTO_AES_ICM, key)
-		enc = c.encrypt(pt, iv)
+        c = Crypto(CRYPTO_AES_ICM, key)
+        enc = c.encrypt(pt, iv)
 
-		print('enc:', enc.encode('hex'))
-		print(' ct:', ct.encode('hex'))
+        print('enc:', enc.encode('hex'))
+        print(' ct:', ct.encode('hex'))
 
-		assert ct == enc
+        assert ct == enc
 
-		dec = c.decrypt(ct, iv)
+        dec = c.decrypt(ct, iv)
 
-		print('dec:', dec.encode('hex'))
-		print(' pt:', pt.encode('hex'))
+        print('dec:', dec.encode('hex'))
+        print(' pt:', pt.encode('hex'))
 
-		assert pt == dec
-	elif False:
-		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-		iv = _spdechex('6eba2716ec0bd6fa5cdef5e6d3a795bc')
-		pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
-		ct = _spdechex('f1f81f12e72e992dbdc304032705dc75dc3e4180eff8ee4819906af6aee876d5b00b7c36d282a445ce3620327be481e8e53a8e5a8e5ca9abfeb2281be88d12ffa8f46d958d8224738c1f7eea48bda03edbf9adeb900985f4fa25648b406d13a886c25e70cfdecdde0ad0f2991420eb48a61c64fd797237cf2798c2675b9bb744360b0a3f329ac53bbceb4e3e7456e6514f1a9d2f06c236c31d0f080b79c15dce1096357416602520daa098b17d1af427')
-		c = Crypto(CRYPTO_AES_CBC, key)
+        assert pt == dec
+    elif False:
+        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+        iv = _spdechex('6eba2716ec0bd6fa5cdef5e6d3a795bc')
+        pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
+        ct = _spdechex('f1f81f12e72e992dbdc304032705dc75dc3e4180eff8ee4819906af6aee876d5b00b7c36d282a445ce3620327be481e8e53a8e5a8e5ca9abfeb2281be88d12ffa8f46d958d8224738c1f7eea48bda03edbf9adeb900985f4fa25648b406d13a886c25e70cfdecdde0ad0f2991420eb48a61c64fd797237cf2798c2675b9bb744360b0a3f329ac53bbceb4e3e7456e6514f1a9d2f06c236c31d0f080b79c15dce1096357416602520daa098b17d1af427')
+        c = Crypto(CRYPTO_AES_CBC, key)
 
-		enc = c.encrypt(pt, iv)
+        enc = c.encrypt(pt, iv)
 
-		print('enc:', enc.encode('hex'))
-		print(' ct:', ct.encode('hex'))
+        print('enc:', enc.encode('hex'))
+        print(' ct:', ct.encode('hex'))
 
-		assert ct == enc
+        assert ct == enc
 
-		dec = c.decrypt(ct, iv)
+        dec = c.decrypt(ct, iv)
 
-		print('dec:', dec.encode('hex'))
-		print(' pt:', pt.encode('hex'))
+        print('dec:', dec.encode('hex'))
+        print(' pt:', pt.encode('hex'))
 
-		assert pt == dec
-	elif False:
-		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-		iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
-		pt = _spdechex('c3b3c41f113a31b73d9a5cd4321030')
-		aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
-		ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
-		ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa73')
-		tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
-		tag = _spdechex('8d11a0929cb3fbe1fef01a4a38d5f8ea')
+        assert pt == dec
+    elif False:
+        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+        iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
+        pt = _spdechex('c3b3c41f113a31b73d9a5cd4321030')
+        aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
+        ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
+        ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa73')
+        tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
+        tag = _spdechex('8d11a0929cb3fbe1fef01a4a38d5f8ea')
 
-		c = Crypto(CRYPTO_AES_NIST_GCM_16, key,
-		    mac=CRYPTO_AES_128_NIST_GMAC, mackey=key)
+        c = Crypto(CRYPTO_AES_NIST_GCM_16, key,
+            mac=CRYPTO_AES_128_NIST_GMAC, mackey=key)
 
-		enc, enctag = c.encrypt(pt, iv, aad=aad)
+        enc, enctag = c.encrypt(pt, iv, aad=aad)
 
-		print('enc:', enc.encode('hex'))
-		print(' ct:', ct.encode('hex'))
+        print('enc:', enc.encode('hex'))
+        print(' ct:', ct.encode('hex'))
 
-		assert enc == ct
+        assert enc == ct
 
-		print('etg:', enctag.encode('hex'))
-		print('tag:', tag.encode('hex'))
-		assert enctag == tag
+        print('etg:', enctag.encode('hex'))
+        print('tag:', tag.encode('hex'))
+        assert enctag == tag
 
-		# Make sure we get EBADMSG
-		#enctag = enctag[:-1] + 'a'
-		dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag)
+        # Make sure we get EBADMSG
+        #enctag = enctag[:-1] + 'a'
+        dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag)
 
-		print('dec:', dec.encode('hex'))
-		print(' pt:', pt.encode('hex'))
+        print('dec:', dec.encode('hex'))
+        print(' pt:', pt.encode('hex'))
 
-		assert dec == pt
+        assert dec == pt
 
-		print('dtg:', dectag.encode('hex'))
-		print('tag:', tag.encode('hex'))
+        print('dtg:', dectag.encode('hex'))
+        print('tag:', tag.encode('hex'))
 
-		assert dectag == tag
-	elif False:
-		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-		iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
-		key = key + iv[:4]
-		iv = iv[4:]
-		pt = _spdechex('c3b3c41f113a31b73d9a5cd432103069')
-		aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
-		ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
-		tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
+        assert dectag == tag
+    elif False:
+        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+        iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
+        key = key + iv[:4]
+        iv = iv[4:]
+        pt = _spdechex('c3b3c41f113a31b73d9a5cd432103069')
+        aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
+        ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
+        tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
 
-		c = Crypto(CRYPTO_AES_GCM_16, key, mac=CRYPTO_AES_128_GMAC, mackey=key)
+        c = Crypto(CRYPTO_AES_GCM_16, key, mac=CRYPTO_AES_128_GMAC, mackey=key)
 
-		enc, enctag = c.encrypt(pt, iv, aad=aad)
+        enc, enctag = c.encrypt(pt, iv, aad=aad)
 
-		print('enc:', enc.encode('hex'))
-		print(' ct:', ct.encode('hex'))
+        print('enc:', enc.encode('hex'))
+        print(' ct:', ct.encode('hex'))
 
-		assert enc == ct
+        assert enc == ct
 
-		print('etg:', enctag.encode('hex'))
-		print('tag:', tag.encode('hex'))
-		assert enctag == tag
-	elif False:
-		for i in xrange(100000):
-			c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
-			data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
-			ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
-			iv = _pack('QQ', 71, 0)
+        print('etg:', enctag.encode('hex'))
+        print('tag:', tag.encode('hex'))
+        assert enctag == tag
+    elif False:
+        for i in xrange(100000):
+            c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
+            data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
+            ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
+            iv = _pack('QQ', 71, 0)
 
-			enc = c.encrypt(data, iv)
-			assert enc == ct
-	elif True:
-		c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
-		data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
-		ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
-		iv = _pack('QQ', 71, 0)
+            enc = c.encrypt(data, iv)
+            assert enc == ct
+    elif True:
+        c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
+        data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
+        ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
+        iv = _pack('QQ', 71, 0)
 
-		enc = c.encrypt(data, iv)
-		assert enc == ct
+        enc = c.encrypt(data, iv)
+        assert enc == ct
 
-		dec = c.decrypt(enc, iv)
-		assert dec == data
+        dec = c.decrypt(enc, iv)
+        assert dec == data
 
-		#c.perftest(COP_ENCRYPT, 192*1024, reps=30000)
+        #c.perftest(COP_ENCRYPT, 192*1024, reps=30000)
 
-	else:
-		key = '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex')
-		print('XTS %d testing:' % (len(key) * 8))
-		c = Crypto(CRYPTO_AES_XTS, key)
-		for i in [ 8192, 192*1024]:
-			print('block size: %d' % i)
-			c.perftest(COP_ENCRYPT, i)
-			c.perftest(COP_DECRYPT, i)
+    else:
+        key = '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex')
+        print('XTS %d testing:' % (len(key) * 8))
+        c = Crypto(CRYPTO_AES_XTS, key)
+        for i in [ 8192, 192*1024]:
+            print('block size: %d' % i)
+            c.perftest(COP_ENCRYPT, i)
+            c.perftest(COP_DECRYPT, i)

Modified: head/tests/sys/opencrypto/cryptotest.py
==============================================================================
--- head/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 15:06:58 2019	(r346442)
+++ head/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 15:43:28 2019	(r346443)
@@ -42,290 +42,290 @@ from glob import iglob
 katdir = '/usr/local/share/nist-kat'
 
 def katg(base, glob):
-	assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install nist-kat'"
-	return iglob(os.path.join(katdir, base, glob))
+    assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install nist-kat'"
+    return iglob(os.path.join(katdir, base, glob))
 
 aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ]
 desmodules = [ 'cryptosoft0', ]
 shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ]
 
 def GenTestCase(cname):
-	try:
-		crid = cryptodev.Crypto.findcrid(cname)
-	except IOError:
-		return None
+    try:
+        crid = cryptodev.Crypto.findcrid(cname)
+    except IOError:
+        return None
 
-	class GendCryptoTestCase(unittest.TestCase):
-		###############
-		##### AES #####
-		###############
-		@unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
-		def test_xts(self):
-			for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'):
-				self.runXTS(i, cryptodev.CRYPTO_AES_XTS)
+    class GendCryptoTestCase(unittest.TestCase):
+        ###############
+        ##### AES #####
+        ###############
+        @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
+        def test_xts(self):
+            for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'):
+                self.runXTS(i, cryptodev.CRYPTO_AES_XTS)
 
-		@unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
-		def test_cbc(self):
-			for i in katg('KAT_AES', 'CBC[GKV]*.rsp'):
-				self.runCBC(i)
+        @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
+        def test_cbc(self):
+            for i in katg('KAT_AES', 'CBC[GKV]*.rsp'):
+                self.runCBC(i)
 
-		@unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
-		def test_gcm(self):
-			for i in katg('gcmtestvectors', 'gcmEncrypt*'):
-				self.runGCM(i, 'ENCRYPT')
+        @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
+        def test_gcm(self):
+            for i in katg('gcmtestvectors', 'gcmEncrypt*'):
+                self.runGCM(i, 'ENCRYPT')
 
-			for i in katg('gcmtestvectors', 'gcmDecrypt*'):
-				self.runGCM(i, 'DECRYPT')
+            for i in katg('gcmtestvectors', 'gcmDecrypt*'):
+                self.runGCM(i, 'DECRYPT')
 
-		_gmacsizes = { 32: cryptodev.CRYPTO_AES_256_NIST_GMAC,
-			24: cryptodev.CRYPTO_AES_192_NIST_GMAC,
-			16: cryptodev.CRYPTO_AES_128_NIST_GMAC,
-		}
-		def runGCM(self, fname, mode):
-			curfun = None
-			if mode == 'ENCRYPT':
-				swapptct = False
-				curfun = Crypto.encrypt
-			elif mode == 'DECRYPT':
-				swapptct = True
-				curfun = Crypto.decrypt
-			else:
-				raise RuntimeError('unknown mode: %r' % repr(mode))
+        _gmacsizes = { 32: cryptodev.CRYPTO_AES_256_NIST_GMAC,
+            24: cryptodev.CRYPTO_AES_192_NIST_GMAC,
+            16: cryptodev.CRYPTO_AES_128_NIST_GMAC,
+        }
+        def runGCM(self, fname, mode):
+            curfun = None
+            if mode == 'ENCRYPT':
+                swapptct = False
+                curfun = Crypto.encrypt
+            elif mode == 'DECRYPT':
+                swapptct = True
+                curfun = Crypto.decrypt
+            else:
+                raise RuntimeError('unknown mode: %r' % repr(mode))

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

From owner-svn-src-head@freebsd.org  Sat Apr 20 15:57:06 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A839B156B448;
 Sat, 20 Apr 2019 15:57:06 +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 5036D96433;
 Sat, 20 Apr 2019 15:57:06 +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 26AFF184CC;
 Sat, 20 Apr 2019 15:57:06 +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 x3KFv5Fr043858;
 Sat, 20 Apr 2019 15:57:05 GMT (envelope-from emaste@FreeBSD.org)
Received: (from emaste@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KFv5QA043855;
 Sat, 20 Apr 2019 15:57:05 GMT (envelope-from emaste@FreeBSD.org)
Message-Id: <201904201557.x3KFv5QA043855@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: emaste set sender to
 emaste@FreeBSD.org using -f
From: Ed Maste 
Date: Sat, 20 Apr 2019 15:57:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346445 - in head/sys/compat/linuxkpi/common:
 include/linux src
X-SVN-Group: head
X-SVN-Commit-Author: emaste
X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src
X-SVN-Commit-Revision: 346445
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 5036D96433
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.97)[-0.973,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, 20 Apr 2019 15:57:07 -0000

Author: emaste
Date: Sat Apr 20 15:57:05 2019
New Revision: 346445
URL: https://svnweb.freebsd.org/changeset/base/346445

Log:
  Enable ioremap for aarch64 in the LinuxKPI
  
  Required for Mellanox drivers (e.g. on Ampere eMAG at Packet.com).
  
  PR:		237055
  Submitted by:	Greg V 
  Reviewed by:	hselasky
  Differential Revision:	https://reviews.freebsd.org/D19987

Modified:
  head/sys/compat/linuxkpi/common/include/linux/io.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/io.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/io.h	Sat Apr 20 15:47:57 2019	(r346444)
+++ head/sys/compat/linuxkpi/common/include/linux/io.h	Sat Apr 20 15:57:05 2019	(r346445)
@@ -350,7 +350,7 @@ _outb(u_char data, u_int port)
 }
 #endif
 
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__)
 void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
 #else
 #define	_ioremap_attr(...) NULL

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_compat.c	Sat Apr 20 15:47:57 2019	(r346444)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Sat Apr 20 15:57:05 2019	(r346445)
@@ -1773,7 +1773,7 @@ vmmap_remove(void *addr)
 	return (vmmap);
 }
 
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__)
 void *
 _ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr)
 {
@@ -1796,7 +1796,7 @@ iounmap(void *addr)
 	vmmap = vmmap_remove(addr);
 	if (vmmap == NULL)
 		return;
-#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__)
 	pmap_unmapdev((vm_offset_t)addr, vmmap->vm_size);
 #endif
 	kfree(vmmap);

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:07:30 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D52E156BAB9;
 Sat, 20 Apr 2019 16:07:30 +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 0B4D496DB8;
 Sat, 20 Apr 2019 16:07:30 +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 D98E118683;
 Sat, 20 Apr 2019 16:07:29 +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 x3KG7Tcn051430;
 Sat, 20 Apr 2019 16:07:29 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KG7TY1051429;
 Sat, 20 Apr 2019 16:07:29 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201904201607.x3KG7TY1051429@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Sat, 20 Apr 2019 16:07:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346448 - head/sys/netinet/netdump
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/sys/netinet/netdump
X-SVN-Commit-Revision: 346448
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 0B4D496DB8
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.97)[-0.973,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, 20 Apr 2019 16:07:30 -0000

Author: cem
Date: Sat Apr 20 16:07:29 2019
New Revision: 346448
URL: https://svnweb.freebsd.org/changeset/base/346448

Log:
  netdump: Fix 11 compatibility DIOCSKERNELDUMP ioctl
  
  The logic was present for the 11 version of the DIOCSKERNELDUMP ioctl, but
  had not been updated for the 12 ABI.
  
  Reviewed by:	markj
  Differential Revision:	https://reviews.freebsd.org/D19980

Modified:
  head/sys/netinet/netdump/netdump_client.c

Modified: head/sys/netinet/netdump/netdump_client.c
==============================================================================
--- head/sys/netinet/netdump/netdump_client.c	Sat Apr 20 16:05:04 2019	(r346447)
+++ head/sys/netinet/netdump/netdump_client.c	Sat Apr 20 16:07:29 2019	(r346448)
@@ -1144,13 +1144,25 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c
 
 	error = 0;
 	switch (cmd) {
-	case DIOCSKERNELDUMP:
+#ifdef COMPAT_FREEBSD11
+	case DIOCSKERNELDUMP_FREEBSD11:
 		u = *(u_int *)addr;
 		if (u != 0) {
 			error = ENXIO;
 			break;
 		}
-
+		if (nd_enabled) {
+			nd_enabled = 0;
+			netdump_mbuf_drain();
+		}
+		break;
+#endif
+	case DIOCSKERNELDUMP:
+		kda = (void *)addr;
+		if (kda->kda_enable != 0) {
+			error = ENXIO;
+			break;
+		}
 		if (nd_enabled) {
 			nd_enabled = 0;
 			netdump_mbuf_drain();

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:30:17 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EF28156C4FA;
 Sat, 20 Apr 2019 16:30:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from smtp.freebsd.org (smtp.freebsd.org
 [IPv6:2610:1c1:1:606c::24b:4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "smtp.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E955497D18;
 Sat, 20 Apr 2019 16:30:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from John-Baldwins-MacBook-Pro-3.local (unknown
 [IPv6:2601:648:8880:1e30:fd9b:9ce6:c8c:cc0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client did not present a certificate) (Authenticated sender: jhb)
 by smtp.freebsd.org (Postfix) with ESMTPSA id 521851CB61;
 Sat, 20 Apr 2019 16:30:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto
To: Enji Cooper , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <201904201543.x3KFhSAl037969@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: 
Date: Sat, 20 Apr 2019 09:30:15 -0700
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0)
 Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <201904201543.x3KFhSAl037969@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Rspamd-Queue-Id: E955497D18
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.93 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.93)[-0.931,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: Sat, 20 Apr 2019 16:30:17 -0000

On 4/20/19 8:43 AM, Enji Cooper wrote:
> Author: ngie
> Date: Sat Apr 20 15:43:28 2019
> New Revision: 346443
> URL: https://svnweb.freebsd.org/changeset/base/346443
> 
> Log:
>   tests/sys/opencrypto: fix whitespace per PEP8
>   
>   Replace hard tabs with four-character indentations, per PEP8.
>   
>   This is being done to separate stylistic changes from the tests from functional
>   ones, as I accidentally introduced a bug to the tests when I used four-space
>   indentation locally.
>   
>   No functional change.

Wow, this is really painful for the 4-5 open reviews I have outstanding as it
makes a merge disaster.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:31:09 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48BDE156C59E;
 Sat, 20 Apr 2019 16:31:09 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com
 [IPv6:2607:f8b0:4864:20::533])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C0C8F97ED1;
 Sat, 20 Apr 2019 16:31:08 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pg1-x533.google.com with SMTP id v12so3975517pgq.1;
 Sat, 20 Apr 2019 09:31:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:message-id:mime-version:subject:date:in-reply-to:cc:to
 :references; bh=UYvm75R0Pr6fQNxpbXJF1vGOdRfmxIVW4rBCm6k5er4=;
 b=hWX4APdUs3HWUNtlEB6g5HOrLIT3zPJqGHjr8EsnLDLJI78Y/XCs8rX14LG6TFQLzg
 D8zy7m4UGwl7eVJMAf2INaa4s2NzQAcciuuRTLzScbixWWDZNoz40T1Lkm/Imy+aJSWH
 gQeLpFwPNdE4kJpMmguQna+Ov28byPrOHxt+DtBmHfaLL/lNqE7bT12bE8N9JSuf4fn7
 C+Intm3aU6sY6uzE7jhm6WmPRtYz78qlYrWbuk+gaCkmfcbrozvFw0L2w400x0p+4Y98
 huM0KYU3ZeIjidjXumD+pCBgxHg3d5h5QpZy8MMYgBRXAKcVSxsgaz1x3iY8FlrjhXIC
 ShCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:message-id:mime-version:subject:date
 :in-reply-to:cc:to:references;
 bh=UYvm75R0Pr6fQNxpbXJF1vGOdRfmxIVW4rBCm6k5er4=;
 b=IgDv01rROTFdhPM63WBRZXWjneeryg7rUt5mR3Vv42ccF1n310hZOckV6XTd0KTuHT
 M1dm+CHAB9BYNFJTB0CGReAw6yTzzy3/GmYzPeRffk+5+tV540GI0pMhkfQKOiuzKh/9
 iGz2+6fptzO8K38Jf11a+NACjcTFrhykyLZpAcWoqLpGFKS3wYlD2kEs+piDIoD0b5YI
 i6XnfOVFx/fi80WsYV4S6Z070qBi08qmUDHxVO2bisL7l6mIoocR51Cud0cOT6OMxzW+
 UivPpqbF2ofyTntemwksWrzKbpu/zFuKg/3CGaV+Qsj4MrXxjFu2Si424rqsPXgjnY2S
 BXCA==
X-Gm-Message-State: APjAAAWh3YWV3MpP3uLUhBO+ZAKNqTJ44Z5ZGPi7IRLnhgtkJPJhR3zm
 VazPg3jVn8WPm2KpNuW9jshhBhAFVU4=
X-Google-Smtp-Source: APXvYqxfgI1BR43NDM88BmpZFby3AeIv/SqWv1wP3oCNvYgGC84A8sYcaptzENWy6DCVLgum/RgCcg==
X-Received: by 2002:a63:ed4f:: with SMTP id m15mr10133531pgk.387.1555777867351; 
 Sat, 20 Apr 2019 09:31:07 -0700 (PDT)
Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id c22sm11905834pfn.136.2019.04.20.09.31.06
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 20 Apr 2019 09:31:06 -0700 (PDT)
From: Enji Cooper 
Message-Id: 
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto
Date: Sat, 20 Apr 2019 09:31:06 -0700
In-Reply-To: 
Cc: Enji Cooper , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
To: John Baldwin 
References: <201904201543.x3KFhSAl037969@repo.freebsd.org>
 
X-Mailer: Apple Mail (2.3445.102.3)
X-Rspamd-Queue-Id: C0C8F97ED1
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.972,0]; REPLY(-4.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
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: Sat, 20 Apr 2019 16:31:09 -0000


> On Apr 20, 2019, at 9:30 AM, John Baldwin  wrote:
>=20
> On 4/20/19 8:43 AM, Enji Cooper wrote:
>> Author: ngie
>> Date: Sat Apr 20 15:43:28 2019
>> New Revision: 346443
>> URL: https://svnweb.freebsd.org/changeset/base/346443
>>=20
>> Log:
>>  tests/sys/opencrypto: fix whitespace per PEP8
>>=20
>>  Replace hard tabs with four-character indentations, per PEP8.
>>=20
>>  This is being done to separate stylistic changes from the tests from =
functional
>>  ones, as I accidentally introduced a bug to the tests when I used =
four-space
>>  indentation locally.
>>=20
>>  No functional change.
>=20
> Wow, this is really painful for the 4-5 open reviews I have =
outstanding as it
> makes a merge disaster.

Sorry ;_;=E2=80=A6
-Enji=

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:32:09 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1CD3156C814;
 Sat, 20 Apr 2019 16:32:08 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com
 [IPv6:2607:f8b0:4864:20::42d])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5706668251;
 Sat, 20 Apr 2019 16:32:08 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pf1-x42d.google.com with SMTP id 10so3827801pfo.5;
 Sat, 20 Apr 2019 09:32:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:message-id:mime-version:subject:date:in-reply-to:cc:to
 :references; bh=KTxr2VsZqnsf1qxmwVfwHouB/j26wXP7KuXQ6a0VSfU=;
 b=VtqkxvuU9n0BVK9L7NAjLLgqQGujKxYYjetjhhuVvG61TfpDcPyqtB0hhEEvw9W2Bz
 THF69GBJJod/xUbO2OBLIr2xte2njiVDEsabn2WJZTnFKnbww4pYJc4bhRrErK7VoJM8
 GSz+t8nxC9XeT/8uPPRT+Z79Ua/evax3W3WsFse0XkVEuXRIC8+Kx6tH1GO3H7+UYRvq
 Z5H1YyEyDm1Ilm4nAL16j4K6keJ7gP3acs1ZhFRmPNI52YjKYlGGMCgoeilskZN2IZAg
 nJpy/Uk3xENAUbfhWAKvQUkWl5l5ggZvZErldaNaOMYc6U5gss0bUaMrHMBSTdHbwXWd
 zUOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:message-id:mime-version:subject:date
 :in-reply-to:cc:to:references;
 bh=KTxr2VsZqnsf1qxmwVfwHouB/j26wXP7KuXQ6a0VSfU=;
 b=WNaED4svCqVWDUoa/EZRGBqVSxho1HtTtF55IpxWdWjY7FeUCUClzv6Y8LIuoyKhd9
 8Ivp92+EwpkU6OZEn6usFhCaNjK1jHQgEwa6KPVsDp2/bXXcPemSe0kxPKNQryj8+OfP
 PveDqgekDiK63VVHk4LuRrx5xq2dkrhEh2QkA3nMxlQut9H6h8ed77rR0H5RGD/Cvh9O
 O3pnSr8oAy4ENvxrfPA6pBTulhOkAXlQ9GsMyw2cB7qJi9NuflNrTjMkImi3N3LzQTds
 z0AM0ZdIc40oFDgYEeBpk6+KD3Jjrw+NGtUCkNps/LVY2LCTcIe2ForXnxQv7f8pU/MZ
 +DnQ==
X-Gm-Message-State: APjAAAWyVPuN4vT9K/EZQ9SeeyVrLJHN35BAMS8AaaNZLPMtA1S2FNs+
 tKiEUZrILfJBIR43ppFd0un5Q0zlmvs=
X-Google-Smtp-Source: APXvYqzgWZ3oUgE7j6ylRVR9g2gzdIaA/cMptyW0CsLuhCIqR+0S+Akwo4V0rzH19OKdFanJQLtIWw==
X-Received: by 2002:a62:4ec8:: with SMTP id
 c191mr10771752pfb.138.1555777927164; 
 Sat, 20 Apr 2019 09:32:07 -0700 (PDT)
Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id c22sm11905834pfn.136.2019.04.20.09.32.06
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 20 Apr 2019 09:32:06 -0700 (PDT)
From: Enji Cooper 
Message-Id: 
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto
Date: Sat, 20 Apr 2019 09:32:06 -0700
In-Reply-To: 
Cc: Enji Cooper , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
To: John Baldwin 
References: <201904201543.x3KFhSAl037969@repo.freebsd.org>
 
 
X-Mailer: Apple Mail (2.3445.102.3)
X-Rspamd-Queue-Id: 5706668251
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.972,0];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
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: Sat, 20 Apr 2019 16:32:09 -0000


> On Apr 20, 2019, at 9:31 AM, Enji Cooper  =
wrote:
>=20
>=20
>> On Apr 20, 2019, at 9:30 AM, John Baldwin > wrote:
>>=20
>> On 4/20/19 8:43 AM, Enji Cooper wrote:
>>> Author: ngie
>>> Date: Sat Apr 20 15:43:28 2019
>>> New Revision: 346443
>>> URL: https://svnweb.freebsd.org/changeset/base/346443 =

>>>=20
>>> Log:
>>>  tests/sys/opencrypto: fix whitespace per PEP8
>>>=20
>>>  Replace hard tabs with four-character indentations, per PEP8.
>>>=20
>>>  This is being done to separate stylistic changes from the tests =
from functional
>>>  ones, as I accidentally introduced a bug to the tests when I used =
four-space
>>>  indentation locally.
>>>=20
>>>  No functional change.
>>=20
>> Wow, this is really painful for the 4-5 open reviews I have =
outstanding as it
>> makes a merge disaster.
>=20
> Sorry ;_;=E2=80=A6

	Being more constructive: I will back out the change, then =
reapply it later.
Thank you,
-Enji


From owner-svn-src-head@freebsd.org  Sat Apr 20 16:37:29 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CA1A156C9E6;
 Sat, 20 Apr 2019 16:37:29 +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 E1C4E6855D;
 Sat, 20 Apr 2019 16:37:28 +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 AEFA018BAF;
 Sat, 20 Apr 2019 16:37:28 +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 x3KGbS0C067414;
 Sat, 20 Apr 2019 16:37:28 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KGbSxi067413;
 Sat, 20 Apr 2019 16:37:28 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201904201637.x3KGbSxi067413@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Enji Cooper 
Date: Sat, 20 Apr 2019 16:37:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346452 - head/tests/sys/opencrypto
X-SVN-Group: head
X-SVN-Commit-Author: ngie
X-SVN-Commit-Paths: head/tests/sys/opencrypto
X-SVN-Commit-Revision: 346452
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: E1C4E6855D
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];
 NEURAL_HAM_LONG(-1.00)[-1.000,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, 20 Apr 2019 16:37:29 -0000

Author: ngie
Date: Sat Apr 20 16:37:28 2019
New Revision: 346452
URL: https://svnweb.freebsd.org/changeset/base/346452

Log:
  Revert r346443
  
  My wide sweeping stylistic change (while well intended) is impeding others from
  working on `tests/sys/opencrypto`.
  
  The plan is to revert the change in ^/head, then reintroduce the changes after
  the other changes get merged into ^/head .
  
  Approved by:	emaste (mentor; implicit)
  Requested by:	jhb
  MFC after:	2 months

Modified:
  head/tests/sys/opencrypto/cryptodev.py
  head/tests/sys/opencrypto/cryptotest.py

Modified: head/tests/sys/opencrypto/cryptodev.py
==============================================================================
--- head/tests/sys/opencrypto/cryptodev.py	Sat Apr 20 16:28:06 2019	(r346451)
+++ head/tests/sys/opencrypto/cryptodev.py	Sat Apr 20 16:37:28 2019	(r346452)
@@ -43,65 +43,65 @@ from cryptodevh import *
 __all__ = [ 'Crypto', 'MismatchError', ]
 
 class FindOp(dpkt.Packet):
-    __byte_order__ = '@'
-    __hdr__ = ( ('crid', 'i', 0),
-        ('name', '32s', 0),
-    )
+	__byte_order__ = '@'
+	__hdr__ = ( ('crid', 'i', 0),
+		('name', '32s', 0),
+	)
 
 class SessionOp(dpkt.Packet):
-    __byte_order__ = '@'
-    __hdr__ = ( ('cipher', 'I', 0),
-        ('mac', 'I', 0),
-        ('keylen', 'I', 0),
-        ('key', 'P', 0),
-        ('mackeylen', 'i', 0),
-        ('mackey', 'P', 0),
-        ('ses', 'I', 0),
-    )
+	__byte_order__ = '@'
+	__hdr__ = ( ('cipher', 'I', 0),
+		('mac', 'I', 0),
+		('keylen', 'I', 0),
+		('key', 'P', 0),
+		('mackeylen', 'i', 0),
+		('mackey', 'P', 0),
+		('ses', 'I', 0),
+	)
 
 class SessionOp2(dpkt.Packet):
-    __byte_order__ = '@'
-    __hdr__ = ( ('cipher', 'I', 0),
-        ('mac', 'I', 0),
-        ('keylen', 'I', 0),
-        ('key', 'P', 0),
-        ('mackeylen', 'i', 0),
-        ('mackey', 'P', 0),
-        ('ses', 'I', 0),
-        ('crid', 'i', 0),
-        ('pad0', 'i', 0),
-        ('pad1', 'i', 0),
-        ('pad2', 'i', 0),
-        ('pad3', 'i', 0),
-    )
+	__byte_order__ = '@'
+	__hdr__ = ( ('cipher', 'I', 0),
+		('mac', 'I', 0),
+		('keylen', 'I', 0),
+		('key', 'P', 0),
+		('mackeylen', 'i', 0),
+		('mackey', 'P', 0),
+		('ses', 'I', 0),
+		('crid', 'i', 0),
+		('pad0', 'i', 0),
+		('pad1', 'i', 0),
+		('pad2', 'i', 0),
+		('pad3', 'i', 0),
+	)
 
 class CryptOp(dpkt.Packet):
-    __byte_order__ = '@'
-    __hdr__ = ( ('ses', 'I', 0),
-        ('op', 'H', 0),
-        ('flags', 'H', 0),
-        ('len', 'I', 0),
-        ('src', 'P', 0),
-        ('dst', 'P', 0),
-        ('mac', 'P', 0),
-        ('iv', 'P', 0),
-    )
+	__byte_order__ = '@'
+	__hdr__ = ( ('ses', 'I', 0),
+		('op', 'H', 0),
+		('flags', 'H', 0),
+		('len', 'I', 0),
+		('src', 'P', 0),
+		('dst', 'P', 0),
+		('mac', 'P', 0),
+		('iv', 'P', 0),
+	)
 
 class CryptAEAD(dpkt.Packet):
-    __byte_order__ = '@'
-    __hdr__ = (
-        ('ses',        'I', 0),
-        ('op',        'H', 0),
-        ('flags',    'H', 0),
-        ('len',        'I', 0),
-        ('aadlen',    'I', 0),
-        ('ivlen',    'I', 0),
-        ('src',        'P', 0),
-        ('dst',        'P', 0),
-        ('aad',        'P', 0),
-        ('tag',        'P', 0),
-        ('iv',        'P', 0),
-    )
+	__byte_order__ = '@'
+	__hdr__ = (
+		('ses',		'I', 0),
+		('op',		'H', 0),
+		('flags',	'H', 0),
+		('len',		'I', 0),
+		('aadlen',	'I', 0),
+		('ivlen',	'I', 0),
+		('src',		'P', 0),
+		('dst',		'P', 0),
+		('aad',		'P', 0),
+		('tag',		'P', 0),
+		('iv',		'P', 0),
+	)
 
 # h2py.py can't handle multiarg macros
 CRIOGET = 3221513060
@@ -116,445 +116,445 @@ CIOCFINDDEV = 3223610220
 CIOCCRYPTAEAD = 3225445229
 
 def _getdev():
-    fd = os.open('/dev/crypto', os.O_RDWR)
-    buf = array.array('I', [0])
-    ioctl(fd, CRIOGET, buf, 1)
-    os.close(fd)
+	fd = os.open('/dev/crypto', os.O_RDWR)
+	buf = array.array('I', [0])
+	ioctl(fd, CRIOGET, buf, 1)
+	os.close(fd)
 
-    return buf[0]
+	return buf[0]
 
 _cryptodev = _getdev()
 
 def _findop(crid, name):
-    fop = FindOp()
-    fop.crid = crid
-    fop.name = name
-    s = array.array('B', fop.pack_hdr())
-    ioctl(_cryptodev, CIOCFINDDEV, s, 1)
-    fop.unpack(s)
+	fop = FindOp()
+	fop.crid = crid
+	fop.name = name
+	s = array.array('B', fop.pack_hdr())
+	ioctl(_cryptodev, CIOCFINDDEV, s, 1)
+	fop.unpack(s)
 
-    try:
-        idx = fop.name.index('\x00')
-        name = fop.name[:idx]
-    except ValueError:
-        name = fop.name
+	try:
+		idx = fop.name.index('\x00')
+		name = fop.name[:idx]
+	except ValueError:
+		name = fop.name
 
-    return fop.crid, name
+	return fop.crid, name
 
 class Crypto:
-    @staticmethod
-    def findcrid(name):
-        return _findop(-1, name)[0]
+	@staticmethod
+	def findcrid(name):
+		return _findop(-1, name)[0]
 
-    @staticmethod
-    def getcridname(crid):
-        return _findop(crid, '')[1]
+	@staticmethod
+	def getcridname(crid):
+		return _findop(crid, '')[1]
 
-    def __init__(self, cipher=0, key=None, mac=0, mackey=None,
-        crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE):
-        self._ses = None
-        ses = SessionOp2()
-        ses.cipher = cipher
-        ses.mac = mac
+	def __init__(self, cipher=0, key=None, mac=0, mackey=None,
+	    crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE):
+		self._ses = None
+		ses = SessionOp2()
+		ses.cipher = cipher
+		ses.mac = mac
 
-        if key is not None:
-            ses.keylen = len(key)
-            k = array.array('B', key)
-            ses.key = k.buffer_info()[0]
-        else:
-            self.key = None
+		if key is not None:
+			ses.keylen = len(key)
+			k = array.array('B', key)
+			ses.key = k.buffer_info()[0]
+		else:
+			self.key = None
 
-        if mackey is not None:
-            ses.mackeylen = len(mackey)
-            mk = array.array('B', mackey)
-            ses.mackey = mk.buffer_info()[0]
-            self._maclen = 16    # parameterize?
-        else:
-            self._maclen = None
+		if mackey is not None:
+			ses.mackeylen = len(mackey)
+			mk = array.array('B', mackey)
+			ses.mackey = mk.buffer_info()[0]
+			self._maclen = 16	# parameterize?
+		else:
+			self._maclen = None
 
-        if not cipher and not mac:
-            raise ValueError('one of cipher or mac MUST be specified.')
-        ses.crid = crid
-        #print(ses)
-        s = array.array('B', ses.pack_hdr())
-        #print(s)
-        ioctl(_cryptodev, CIOCGSESSION2, s, 1)
-        ses.unpack(s)
+		if not cipher and not mac:
+			raise ValueError('one of cipher or mac MUST be specified.')
+		ses.crid = crid
+		#print(ses)
+		s = array.array('B', ses.pack_hdr())
+		#print(s)
+		ioctl(_cryptodev, CIOCGSESSION2, s, 1)
+		ses.unpack(s)
 
-        self._ses = ses.ses
+		self._ses = ses.ses
 
-    def __del__(self):
-        if self._ses is None:
-            return
+	def __del__(self):
+		if self._ses is None:
+			return
 
-        try:
-            ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses))
-        except TypeError:
-            pass
-        self._ses = None
+		try:
+			ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses))
+		except TypeError:
+			pass
+		self._ses = None
 
-    def _doop(self, op, src, iv):
-        cop = CryptOp()
-        cop.ses = self._ses
-        cop.op = op
-        cop.flags = 0
-        cop.len = len(src)
-        s = array.array('B', src)
-        cop.src = cop.dst = s.buffer_info()[0]
-        if self._maclen is not None:
-            m = array.array('B', [0] * self._maclen)
-            cop.mac = m.buffer_info()[0]
-        ivbuf = array.array('B', iv)
-        cop.iv = ivbuf.buffer_info()[0]
+	def _doop(self, op, src, iv):
+		cop = CryptOp()
+		cop.ses = self._ses
+		cop.op = op
+		cop.flags = 0
+		cop.len = len(src)
+		s = array.array('B', src)
+		cop.src = cop.dst = s.buffer_info()[0]
+		if self._maclen is not None:
+			m = array.array('B', [0] * self._maclen)
+			cop.mac = m.buffer_info()[0]
+		ivbuf = array.array('B', iv)
+		cop.iv = ivbuf.buffer_info()[0]
 
-        #print('cop:', cop)
-        ioctl(_cryptodev, CIOCCRYPT, str(cop))
+		#print('cop:', cop)
+		ioctl(_cryptodev, CIOCCRYPT, str(cop))
 
-        s = s.tostring()
-        if self._maclen is not None:
-            return s, m.tostring()
+		s = s.tostring()
+		if self._maclen is not None:
+			return s, m.tostring()
 
-        return s
+		return s
 
-    def _doaead(self, op, src, aad, iv, tag=None):
-        caead = CryptAEAD()
-        caead.ses = self._ses
-        caead.op = op
-        caead.flags = CRD_F_IV_EXPLICIT
-        caead.flags = 0
-        caead.len = len(src)
-        s = array.array('B', src)
-        caead.src = caead.dst = s.buffer_info()[0]
-        caead.aadlen = len(aad)
-        saad = array.array('B', aad)
-        caead.aad = saad.buffer_info()[0]
+	def _doaead(self, op, src, aad, iv, tag=None):
+		caead = CryptAEAD()
+		caead.ses = self._ses
+		caead.op = op
+		caead.flags = CRD_F_IV_EXPLICIT
+		caead.flags = 0
+		caead.len = len(src)
+		s = array.array('B', src)
+		caead.src = caead.dst = s.buffer_info()[0]
+		caead.aadlen = len(aad)
+		saad = array.array('B', aad)
+		caead.aad = saad.buffer_info()[0]
 
-        if self._maclen is None:
-            raise ValueError('must have a tag length')
+		if self._maclen is None:
+			raise ValueError('must have a tag length')
 
-        if tag is None:
-            tag = array.array('B', [0] * self._maclen)
-        else:
-            assert len(tag) == self._maclen, \
+		if tag is None:
+			tag = array.array('B', [0] * self._maclen)
+		else:
+			assert len(tag) == self._maclen, \
                 '%d != %d' % (len(tag), self._maclen)
-            tag = array.array('B', tag)
+			tag = array.array('B', tag)
 
-        caead.tag = tag.buffer_info()[0]
+		caead.tag = tag.buffer_info()[0]
 
-        ivbuf = array.array('B', iv)
-        caead.ivlen = len(iv)
-        caead.iv = ivbuf.buffer_info()[0]
+		ivbuf = array.array('B', iv)
+		caead.ivlen = len(iv)
+		caead.iv = ivbuf.buffer_info()[0]
 
-        ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead))
+		ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead))
 
-        s = s.tostring()
+		s = s.tostring()
 
-        return s, tag.tostring()
+		return s, tag.tostring()
 
-    def perftest(self, op, size, timeo=3):
-        import random
-        import time
+	def perftest(self, op, size, timeo=3):
+		import random
+		import time
 
-        inp = array.array('B', (random.randint(0, 255) for x in xrange(size)))
-        out = array.array('B', inp)
+		inp = array.array('B', (random.randint(0, 255) for x in xrange(size)))
+		out = array.array('B', inp)
 
-        # prep ioctl
-        cop = CryptOp()
-        cop.ses = self._ses
-        cop.op = op
-        cop.flags = 0
-        cop.len = len(inp)
-        s = array.array('B', inp)
-        cop.src = s.buffer_info()[0]
-        cop.dst = out.buffer_info()[0]
-        if self._maclen is not None:
-            m = array.array('B', [0] * self._maclen)
-            cop.mac = m.buffer_info()[0]
-        ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16)))
-        cop.iv = ivbuf.buffer_info()[0]
+		# prep ioctl
+		cop = CryptOp()
+		cop.ses = self._ses
+		cop.op = op
+		cop.flags = 0
+		cop.len = len(inp)
+		s = array.array('B', inp)
+		cop.src = s.buffer_info()[0]
+		cop.dst = out.buffer_info()[0]
+		if self._maclen is not None:
+			m = array.array('B', [0] * self._maclen)
+			cop.mac = m.buffer_info()[0]
+		ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16)))
+		cop.iv = ivbuf.buffer_info()[0]
 
-        exit = [ False ]
-        def alarmhandle(a, b, exit=exit):
-            exit[0] = True
+		exit = [ False ]
+		def alarmhandle(a, b, exit=exit):
+			exit[0] = True
 
-        oldalarm = signal.signal(signal.SIGALRM, alarmhandle)
-        signal.alarm(timeo)
+		oldalarm = signal.signal(signal.SIGALRM, alarmhandle)
+		signal.alarm(timeo)
 
-        start = time.time()
-        reps = 0
-        while not exit[0]:
-            ioctl(_cryptodev, CIOCCRYPT, str(cop))
-            reps += 1
+		start = time.time()
+		reps = 0
+		while not exit[0]:
+			ioctl(_cryptodev, CIOCCRYPT, str(cop))
+			reps += 1
 
-        end = time.time()
+		end = time.time()
 
-        signal.signal(signal.SIGALRM, oldalarm)
+		signal.signal(signal.SIGALRM, oldalarm)
 
-        print('time:', end - start)
-        print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024)
+		print('time:', end - start)
+		print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024)
 
-    def encrypt(self, data, iv, aad=None):
-        if aad is None:
-            return self._doop(COP_ENCRYPT, data, iv)
-        else:
-            return self._doaead(COP_ENCRYPT, data, aad,
-                iv)
+	def encrypt(self, data, iv, aad=None):
+		if aad is None:
+			return self._doop(COP_ENCRYPT, data, iv)
+		else:
+			return self._doaead(COP_ENCRYPT, data, aad,
+			    iv)
 
-    def decrypt(self, data, iv, aad=None, tag=None):
-        if aad is None:
-            return self._doop(COP_DECRYPT, data, iv)
-        else:
-            return self._doaead(COP_DECRYPT, data, aad,
-                iv, tag=tag)
+	def decrypt(self, data, iv, aad=None, tag=None):
+		if aad is None:
+			return self._doop(COP_DECRYPT, data, iv)
+		else:
+			return self._doaead(COP_DECRYPT, data, aad,
+			    iv, tag=tag)
 
 class MismatchError(Exception):
-    pass
+	pass
 
 class KATParser:
-    def __init__(self, fname, fields):
-        self.fp = open(fname)
-        self.fields = set(fields)
-        self._pending = None
+	def __init__(self, fname, fields):
+		self.fp = open(fname)
+		self.fields = set(fields)
+		self._pending = None
 
-    def __iter__(self):
-        while True:
-            didread = False
-            if self._pending is not None:
-                i = self._pending
-                self._pending = None
-            else:
-                i = self.fp.readline()
-                didread = True
+	def __iter__(self):
+		while True:
+			didread = False
+			if self._pending is not None:
+				i = self._pending
+				self._pending = None
+			else:
+				i = self.fp.readline()
+				didread = True
 
-            if didread and not i:
-                return
+			if didread and not i:
+				return
 
-            if (i and i[0] == '#') or not i.strip():
-                continue
-            if i[0] == '[':
-                yield i[1:].split(']', 1)[0], self.fielditer()
-            else:
-                raise ValueError('unknown line: %r' % repr(i))
+			if (i and i[0] == '#') or not i.strip():
+				continue
+			if i[0] == '[':
+				yield i[1:].split(']', 1)[0], self.fielditer()
+			else:
+				raise ValueError('unknown line: %r' % repr(i))
 
-    def eatblanks(self):
-        while True:
-            line = self.fp.readline()
-            if line == '':
-                break
+	def eatblanks(self):
+		while True:
+			line = self.fp.readline()
+			if line == '':
+				break
 
-            line = line.strip()
-            if line:
-                break
+			line = line.strip()
+			if line:
+				break
 
-        return line
+		return line
 
-    def fielditer(self):
-        while True:
-            values = {}
+	def fielditer(self):
+		while True:
+			values = {}
 
-            line = self.eatblanks()
-            if not line or line[0] == '[':
-                self._pending = line
-                return
+			line = self.eatblanks()
+			if not line or line[0] == '[':
+				self._pending = line
+				return
 
-            while True:
-                try:
-                    f, v = line.split(' =')
-                except:
-                    if line == 'FAIL':
-                        f, v = 'FAIL', ''
-                    else:
-                        print('line:', repr(line))
-                        raise
-                v = v.strip()
+			while True:
+				try:
+					f, v = line.split(' =')
+				except:
+					if line == 'FAIL':
+						f, v = 'FAIL', ''
+					else:
+						print('line:', repr(line))
+						raise
+				v = v.strip()
 
-                if f in values:
-                    raise ValueError('already present: %r' % repr(f))
-                values[f] = v
-                line = self.fp.readline().strip()
-                if not line:
-                    break
+				if f in values:
+					raise ValueError('already present: %r' % repr(f))
+				values[f] = v
+				line = self.fp.readline().strip()
+				if not line:
+					break
 
-            # we should have everything
-            remain = self.fields.copy() - set(values.keys())
-            # XXX - special case GCM decrypt
-            if remain and not ('FAIL' in values and 'PT' in remain):
-                raise ValueError('not all fields found: %r' % repr(remain))
+			# we should have everything
+			remain = self.fields.copy() - set(values.keys())
+			# XXX - special case GCM decrypt
+			if remain and not ('FAIL' in values and 'PT' in remain):
+				raise ValueError('not all fields found: %r' % repr(remain))
 
-            yield values
+			yield values
 
 def _spdechex(s):
-    return ''.join(s.split()).decode('hex')
+	return ''.join(s.split()).decode('hex')
 
 if __name__ == '__main__':
-    if True:
-        try:
-            crid = Crypto.findcrid('aesni0')
-            print('aesni:', crid)
-        except IOError:
-            print('aesni0 not found')
+	if True:
+		try:
+			crid = Crypto.findcrid('aesni0')
+			print('aesni:', crid)
+		except IOError:
+			print('aesni0 not found')
 
-        for i in xrange(10):
-            try:
-                name = Crypto.getcridname(i)
-                print('%2d: %r' % (i, repr(name)))
-            except IOError:
-                pass
-    elif False:
-        kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ])
-        for mode, ni in kp:
-            print(i, ni)
-            for j in ni:
-                print(j)
-    elif False:
-        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-        iv = _spdechex('00000000000000000000000000000001')
-        pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e')
-        #pt = _spdechex('00000000000000000000000000000000')
-        ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef')
+		for i in xrange(10):
+			try:
+				name = Crypto.getcridname(i)
+				print('%2d: %r' % (i, repr(name)))
+			except IOError:
+				pass
+	elif False:
+		kp = KATParser('/usr/home/jmg/aesni.testing/format tweak value input - data unit seq no/XTSGenAES128.rsp', [ 'COUNT', 'DataUnitLen', 'Key', 'DataUnitSeqNumber', 'PT', 'CT' ])
+		for mode, ni in kp:
+			print(i, ni)
+			for j in ni:
+				print(j)
+	elif False:
+		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+		iv = _spdechex('00000000000000000000000000000001')
+		pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e')
+		#pt = _spdechex('00000000000000000000000000000000')
+		ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef')
 
-        c = Crypto(CRYPTO_AES_ICM, key)
-        enc = c.encrypt(pt, iv)
+		c = Crypto(CRYPTO_AES_ICM, key)
+		enc = c.encrypt(pt, iv)
 
-        print('enc:', enc.encode('hex'))
-        print(' ct:', ct.encode('hex'))
+		print('enc:', enc.encode('hex'))
+		print(' ct:', ct.encode('hex'))
 
-        assert ct == enc
+		assert ct == enc
 
-        dec = c.decrypt(ct, iv)
+		dec = c.decrypt(ct, iv)
 
-        print('dec:', dec.encode('hex'))
-        print(' pt:', pt.encode('hex'))
+		print('dec:', dec.encode('hex'))
+		print(' pt:', pt.encode('hex'))
 
-        assert pt == dec
-    elif False:
-        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-        iv = _spdechex('00000000000000000000000000000001')
-        pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
-        #pt = _spdechex('00000000000000000000000000000000')
-        ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef3768')
+		assert pt == dec
+	elif False:
+		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+		iv = _spdechex('00000000000000000000000000000001')
+		pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
+		#pt = _spdechex('00000000000000000000000000000000')
+		ct = _spdechex('f42c33853ecc5ce2949865fdb83de3bff1089e9360c94f830baebfaff72836ab5236f77212f1e7396c8c54ac73d81986375a6e9e299cfeca5ba051ed25e8d1affa5beaf6c1d2b45e90802408f2ced21663497e906de5f29341e5e52ddfea5363d628b3eb7806835e17bae051b3a6da3f8e2941fe44384eac17a9d298d2c331ca8320c775b5d53263a5e905059d891b21dede2d8110fd427c7bd5a9a274ddb47b1945ee79522203b6e297d0e399ef3768')
 
-        c = Crypto(CRYPTO_AES_ICM, key)
-        enc = c.encrypt(pt, iv)
+		c = Crypto(CRYPTO_AES_ICM, key)
+		enc = c.encrypt(pt, iv)
 
-        print('enc:', enc.encode('hex'))
-        print(' ct:', ct.encode('hex'))
+		print('enc:', enc.encode('hex'))
+		print(' ct:', ct.encode('hex'))
 
-        assert ct == enc
+		assert ct == enc
 
-        dec = c.decrypt(ct, iv)
+		dec = c.decrypt(ct, iv)
 
-        print('dec:', dec.encode('hex'))
-        print(' pt:', pt.encode('hex'))
+		print('dec:', dec.encode('hex'))
+		print(' pt:', pt.encode('hex'))
 
-        assert pt == dec
-    elif False:
-        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-        iv = _spdechex('6eba2716ec0bd6fa5cdef5e6d3a795bc')
-        pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
-        ct = _spdechex('f1f81f12e72e992dbdc304032705dc75dc3e4180eff8ee4819906af6aee876d5b00b7c36d282a445ce3620327be481e8e53a8e5a8e5ca9abfeb2281be88d12ffa8f46d958d8224738c1f7eea48bda03edbf9adeb900985f4fa25648b406d13a886c25e70cfdecdde0ad0f2991420eb48a61c64fd797237cf2798c2675b9bb744360b0a3f329ac53bbceb4e3e7456e6514f1a9d2f06c236c31d0f080b79c15dce1096357416602520daa098b17d1af427')
-        c = Crypto(CRYPTO_AES_CBC, key)
+		assert pt == dec
+	elif False:
+		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+		iv = _spdechex('6eba2716ec0bd6fa5cdef5e6d3a795bc')
+		pt = _spdechex('ab3cabed693a32946055524052afe3c9cb49664f09fc8b7da824d924006b7496353b8c1657c5dec564d8f38d7432e1de35aae9d95590e66278d4acce883e51abaf94977fcd3679660109a92bf7b2973ccd547f065ec6cee4cb4a72a5e9f45e615d920d76cb34cba482467b3e21422a7242e7d931330c0fbf465c3a3a46fae943029fd899626dda542750a1eee253df323c6ef1573f1c8c156613e2ea0a6cdbf2ae9701020be2d6a83ecb7f3f9d8e0a3f')
+		ct = _spdechex('f1f81f12e72e992dbdc304032705dc75dc3e4180eff8ee4819906af6aee876d5b00b7c36d282a445ce3620327be481e8e53a8e5a8e5ca9abfeb2281be88d12ffa8f46d958d8224738c1f7eea48bda03edbf9adeb900985f4fa25648b406d13a886c25e70cfdecdde0ad0f2991420eb48a61c64fd797237cf2798c2675b9bb744360b0a3f329ac53bbceb4e3e7456e6514f1a9d2f06c236c31d0f080b79c15dce1096357416602520daa098b17d1af427')
+		c = Crypto(CRYPTO_AES_CBC, key)
 
-        enc = c.encrypt(pt, iv)
+		enc = c.encrypt(pt, iv)
 
-        print('enc:', enc.encode('hex'))
-        print(' ct:', ct.encode('hex'))
+		print('enc:', enc.encode('hex'))
+		print(' ct:', ct.encode('hex'))
 
-        assert ct == enc
+		assert ct == enc
 
-        dec = c.decrypt(ct, iv)
+		dec = c.decrypt(ct, iv)
 
-        print('dec:', dec.encode('hex'))
-        print(' pt:', pt.encode('hex'))
+		print('dec:', dec.encode('hex'))
+		print(' pt:', pt.encode('hex'))
 
-        assert pt == dec
-    elif False:
-        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-        iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
-        pt = _spdechex('c3b3c41f113a31b73d9a5cd4321030')
-        aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
-        ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
-        ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa73')
-        tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
-        tag = _spdechex('8d11a0929cb3fbe1fef01a4a38d5f8ea')
+		assert pt == dec
+	elif False:
+		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+		iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
+		pt = _spdechex('c3b3c41f113a31b73d9a5cd4321030')
+		aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
+		ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
+		ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa73')
+		tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
+		tag = _spdechex('8d11a0929cb3fbe1fef01a4a38d5f8ea')
 
-        c = Crypto(CRYPTO_AES_NIST_GCM_16, key,
-            mac=CRYPTO_AES_128_NIST_GMAC, mackey=key)
+		c = Crypto(CRYPTO_AES_NIST_GCM_16, key,
+		    mac=CRYPTO_AES_128_NIST_GMAC, mackey=key)
 
-        enc, enctag = c.encrypt(pt, iv, aad=aad)
+		enc, enctag = c.encrypt(pt, iv, aad=aad)
 
-        print('enc:', enc.encode('hex'))
-        print(' ct:', ct.encode('hex'))
+		print('enc:', enc.encode('hex'))
+		print(' ct:', ct.encode('hex'))
 
-        assert enc == ct
+		assert enc == ct
 
-        print('etg:', enctag.encode('hex'))
-        print('tag:', tag.encode('hex'))
-        assert enctag == tag
+		print('etg:', enctag.encode('hex'))
+		print('tag:', tag.encode('hex'))
+		assert enctag == tag
 
-        # Make sure we get EBADMSG
-        #enctag = enctag[:-1] + 'a'
-        dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag)
+		# Make sure we get EBADMSG
+		#enctag = enctag[:-1] + 'a'
+		dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag)
 
-        print('dec:', dec.encode('hex'))
-        print(' pt:', pt.encode('hex'))
+		print('dec:', dec.encode('hex'))
+		print(' pt:', pt.encode('hex'))
 
-        assert dec == pt
+		assert dec == pt
 
-        print('dtg:', dectag.encode('hex'))
-        print('tag:', tag.encode('hex'))
+		print('dtg:', dectag.encode('hex'))
+		print('tag:', tag.encode('hex'))
 
-        assert dectag == tag
-    elif False:
-        key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
-        iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
-        key = key + iv[:4]
-        iv = iv[4:]
-        pt = _spdechex('c3b3c41f113a31b73d9a5cd432103069')
-        aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
-        ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
-        tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
+		assert dectag == tag
+	elif False:
+		key = _spdechex('c939cc13397c1d37de6ae0e1cb7c423c')
+		iv = _spdechex('b3d8cc017cbb89b39e0f67e2')
+		key = key + iv[:4]
+		iv = iv[4:]
+		pt = _spdechex('c3b3c41f113a31b73d9a5cd432103069')
+		aad = _spdechex('24825602bd12a984e0092d3e448eda5f')
+		ct = _spdechex('93fe7d9e9bfd10348a5606e5cafa7354')
+		tag = _spdechex('0032a1dc85f1c9786925a2e71d8272dd')
 
-        c = Crypto(CRYPTO_AES_GCM_16, key, mac=CRYPTO_AES_128_GMAC, mackey=key)
+		c = Crypto(CRYPTO_AES_GCM_16, key, mac=CRYPTO_AES_128_GMAC, mackey=key)
 
-        enc, enctag = c.encrypt(pt, iv, aad=aad)
+		enc, enctag = c.encrypt(pt, iv, aad=aad)
 
-        print('enc:', enc.encode('hex'))
-        print(' ct:', ct.encode('hex'))
+		print('enc:', enc.encode('hex'))
+		print(' ct:', ct.encode('hex'))
 
-        assert enc == ct
+		assert enc == ct
 
-        print('etg:', enctag.encode('hex'))
-        print('tag:', tag.encode('hex'))
-        assert enctag == tag
-    elif False:
-        for i in xrange(100000):
-            c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
-            data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
-            ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
-            iv = _pack('QQ', 71, 0)
+		print('etg:', enctag.encode('hex'))
+		print('tag:', tag.encode('hex'))
+		assert enctag == tag
+	elif False:
+		for i in xrange(100000):
+			c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
+			data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
+			ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
+			iv = _pack('QQ', 71, 0)
 
-            enc = c.encrypt(data, iv)
-            assert enc == ct
-    elif True:
-        c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
-        data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
-        ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
-        iv = _pack('QQ', 71, 0)
+			enc = c.encrypt(data, iv)
+			assert enc == ct
+	elif True:
+		c = Crypto(CRYPTO_AES_XTS, '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex'))
+		data = '52a42bca4e9425a25bbc8c8bf6129dec'.decode('hex')
+		ct = '517e602becd066b65fa4f4f56ddfe240'.decode('hex')
+		iv = _pack('QQ', 71, 0)
 
-        enc = c.encrypt(data, iv)
-        assert enc == ct
+		enc = c.encrypt(data, iv)
+		assert enc == ct
 
-        dec = c.decrypt(enc, iv)
-        assert dec == data
+		dec = c.decrypt(enc, iv)
+		assert dec == data
 
-        #c.perftest(COP_ENCRYPT, 192*1024, reps=30000)
+		#c.perftest(COP_ENCRYPT, 192*1024, reps=30000)
 
-    else:
-        key = '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex')
-        print('XTS %d testing:' % (len(key) * 8))
-        c = Crypto(CRYPTO_AES_XTS, key)
-        for i in [ 8192, 192*1024]:
-            print('block size: %d' % i)
-            c.perftest(COP_ENCRYPT, i)
-            c.perftest(COP_DECRYPT, i)
+	else:
+		key = '1bbfeadf539daedcae33ced497343f3ca1f2474ad932b903997d44707db41382'.decode('hex')
+		print('XTS %d testing:' % (len(key) * 8))
+		c = Crypto(CRYPTO_AES_XTS, key)
+		for i in [ 8192, 192*1024]:
+			print('block size: %d' % i)
+			c.perftest(COP_ENCRYPT, i)
+			c.perftest(COP_DECRYPT, i)

Modified: head/tests/sys/opencrypto/cryptotest.py
==============================================================================
--- head/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 16:28:06 2019	(r346451)
+++ head/tests/sys/opencrypto/cryptotest.py	Sat Apr 20 16:37:28 2019	(r346452)
@@ -42,290 +42,290 @@ from glob import iglob
 katdir = '/usr/local/share/nist-kat'
 
 def katg(base, glob):
-    assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install nist-kat'"
-    return iglob(os.path.join(katdir, base, glob))
+	assert os.path.exists(os.path.join(katdir, base)), "Please 'pkg install nist-kat'"
+	return iglob(os.path.join(katdir, base, glob))
 
 aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ]
 desmodules = [ 'cryptosoft0', ]
 shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ]
 
 def GenTestCase(cname):
-    try:
-        crid = cryptodev.Crypto.findcrid(cname)
-    except IOError:
-        return None
+	try:
+		crid = cryptodev.Crypto.findcrid(cname)
+	except IOError:
+		return None
 
-    class GendCryptoTestCase(unittest.TestCase):
-        ###############
-        ##### AES #####
-        ###############
-        @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
-        def test_xts(self):
-            for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'):
-                self.runXTS(i, cryptodev.CRYPTO_AES_XTS)
+	class GendCryptoTestCase(unittest.TestCase):
+		###############
+		##### AES #####
+		###############
+		@unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
+		def test_xts(self):
+			for i in katg('XTSTestVectors/format tweak value input - data unit seq no', '*.rsp'):
+				self.runXTS(i, cryptodev.CRYPTO_AES_XTS)
 
-        @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
-        def test_cbc(self):
-            for i in katg('KAT_AES', 'CBC[GKV]*.rsp'):
-                self.runCBC(i)
+		@unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
+		def test_cbc(self):
+			for i in katg('KAT_AES', 'CBC[GKV]*.rsp'):
+				self.runCBC(i)
 
-        @unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
-        def test_gcm(self):
-            for i in katg('gcmtestvectors', 'gcmEncrypt*'):
-                self.runGCM(i, 'ENCRYPT')
+		@unittest.skipIf(cname not in aesmodules, 'skipping AES on %s' % (cname))
+		def test_gcm(self):
+			for i in katg('gcmtestvectors', 'gcmEncrypt*'):
+				self.runGCM(i, 'ENCRYPT')
 
-            for i in katg('gcmtestvectors', 'gcmDecrypt*'):
-                self.runGCM(i, 'DECRYPT')
+			for i in katg('gcmtestvectors', 'gcmDecrypt*'):
+				self.runGCM(i, 'DECRYPT')
 
-        _gmacsizes = { 32: cryptodev.CRYPTO_AES_256_NIST_GMAC,
-            24: cryptodev.CRYPTO_AES_192_NIST_GMAC,
-            16: cryptodev.CRYPTO_AES_128_NIST_GMAC,
-        }
-        def runGCM(self, fname, mode):
-            curfun = None
-            if mode == 'ENCRYPT':
-                swapptct = False
-                curfun = Crypto.encrypt
-            elif mode == 'DECRYPT':
-                swapptct = True
-                curfun = Crypto.decrypt
-            else:
-                raise RuntimeError('unknown mode: %r' % repr(mode))
+		_gmacsizes = { 32: cryptodev.CRYPTO_AES_256_NIST_GMAC,
+			24: cryptodev.CRYPTO_AES_192_NIST_GMAC,
+			16: cryptodev.CRYPTO_AES_128_NIST_GMAC,
+		}
+		def runGCM(self, fname, mode):
+			curfun = None
+			if mode == 'ENCRYPT':
+				swapptct = False
+				curfun = Crypto.encrypt
+			elif mode == 'DECRYPT':
+				swapptct = True
+				curfun = Crypto.decrypt
+			else:
+				raise RuntimeError('unknown mode: %r' % repr(mode))

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

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:38:45 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528D6156CAA5;
 Sat, 20 Apr 2019 16:38:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from smtp.freebsd.org (smtp.freebsd.org
 [IPv6:2610:1c1:1:606c::24b:4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "smtp.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E37F669A3E;
 Sat, 20 Apr 2019 16:38:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from John-Baldwins-MacBook-Pro-3.local (unknown
 [IPv6:2601:648:8880:1e30:fd9b:9ce6:c8c:cc0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client did not present a certificate) (Authenticated sender: jhb)
 by smtp.freebsd.org (Postfix) with ESMTPSA id 1B7721CC76;
 Sat, 20 Apr 2019 16:38:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto
To: Enji Cooper 
Cc: Enji Cooper , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <201904201543.x3KFhSAl037969@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: <3dc61795-3802-513e-93ff-3d6493eabe36@FreeBSD.org>
Date: Sat, 20 Apr 2019 09:38:42 -0700
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0)
 Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: 
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: E37F669A3E
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.92 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.92)[-0.919,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: Sat, 20 Apr 2019 16:38:45 -0000

On 4/20/19 9:32 AM, Enji Cooper wrote:
> 
>> On Apr 20, 2019, at 9:31 AM, Enji Cooper  wrote:
>>
>>
>>> On Apr 20, 2019, at 9:30 AM, John Baldwin > wrote:
>>>
>>> On 4/20/19 8:43 AM, Enji Cooper wrote:
>>>> Author: ngie
>>>> Date: Sat Apr 20 15:43:28 2019
>>>> New Revision: 346443
>>>> URL: https://svnweb.freebsd.org/changeset/base/346443 
>>>>
>>>> Log:
>>>>  tests/sys/opencrypto: fix whitespace per PEP8
>>>>
>>>>  Replace hard tabs with four-character indentations, per PEP8.
>>>>
>>>>  This is being done to separate stylistic changes from the tests from functional
>>>>  ones, as I accidentally introduced a bug to the tests when I used four-space
>>>>  indentation locally.
>>>>
>>>>  No functional change.
>>>
>>> Wow, this is really painful for the 4-5 open reviews I have outstanding as it
>>> makes a merge disaster.
>>
>> Sorry ;_;…
> 
> 	Being more constructive: I will back out the change, then reapply it later.
> Thank you,

Ok, is it easy to reapply using a script or some such?  Also, in general I do prefer
this indentation as 1) it works out of the box in emacs, and 2) many of the lines in
cryptotest.py especially are indented pretty far over making it hard to read.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:43:25 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E823156CCFF;
 Sat, 20 Apr 2019 16:43:25 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com
 [IPv6:2607:f8b0:4864:20::536])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 0887169EC9;
 Sat, 20 Apr 2019 16:43:25 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pg1-x536.google.com with SMTP id v12so3982885pgq.1;
 Sat, 20 Apr 2019 09:43:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=Zeo3fBGcDlFI3oUoyUCfOyJD/qv5pHHbGK7uUVJlKiQ=;
 b=r5MaNvS9RPW2f/0DTnr+izQRESOnodE2nD80i7YWX5vNma/GvalO/gfSWgSKWb4lTS
 wwwI6Q7dKPBhpT2EZUVYzbls2VQXlzpv7XnqaoOz1d0TALbojP+L/mRkpk/W/HG/Qpnn
 5m/B/1FRNwe5VBi/QLgie9J2XOH1sk4mc10JzydyJ1Ezqp+3jhYNCLMbN3UyZC8g8xA7
 KThi3xBoNeC/YPS+PSvJdyw7GXeixY0jy50MEQdLYd98EsgwWwKHfIPbXowdQtJJaR0S
 hcC2F1QmtJ3DUTn76md9qru8ZVi3b92qjTiwFPNfN9Nh3eoe7cWIVKMGo31iyotWHIsy
 x1wA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=Zeo3fBGcDlFI3oUoyUCfOyJD/qv5pHHbGK7uUVJlKiQ=;
 b=pZFfEibt9N28Ubgrx9ibm4cDQVM62OhA8NqSUtp9JuzYFIbNUGUYbURt1PQlNnQpW3
 YHLEnkRAGsDHawxp4/NlIZAKdsBWt/L9XWzUnR2yEkxemU5ZsvImRu8NyFDBSA2gLT4O
 bAR6xgRJydXISqvNcRa20MyQNgi7w6ocX/X+s3Pb6kqDNsCCpy62UC/BTUd/IDyFvwqx
 HHEMtcsTjpX34PTVvAuzvl40wI6zcJ+gGrPAjkGFKa0JYNCocdcspaYEUkooH9slC/MW
 JYO+YrFx4GuofbdqtNRtbmgwTTKF9ZZT4u37Xj9gmXngDSbFR1tp+bJcjSTU6+sKgtck
 dJ1w==
X-Gm-Message-State: APjAAAX6wRMYlLvQjGgJWDZ56Pqwvzr/INDhxX8OUJnraf+3e3IuTin0
 BI/CQuYXTbPOjL93xWN5JizxwcIrivs=
X-Google-Smtp-Source: APXvYqzLlzG6dz3jNIoxYvhpX+lbv2DqSPt5KrBQ7MxMIK1WVlaDGHYZ6mc1bFKd0eqcz3AH0nxCRQ==
X-Received: by 2002:a63:28c:: with SMTP id 134mr10047079pgc.278.1555778603666; 
 Sat, 20 Apr 2019 09:43:23 -0700 (PDT)
Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id n20sm22534208pgd.92.2019.04.20.09.43.22
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 20 Apr 2019 09:43:22 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto
From: Enji Cooper 
In-Reply-To: <3dc61795-3802-513e-93ff-3d6493eabe36@FreeBSD.org>
Date: Sat, 20 Apr 2019 09:43:22 -0700
Cc: Enji Cooper , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201904201543.x3KFhSAl037969@repo.freebsd.org>
 
 
 
 <3dc61795-3802-513e-93ff-3d6493eabe36@FreeBSD.org>
To: John Baldwin 
X-Mailer: Apple Mail (2.3445.102.3)
X-Rspamd-Queue-Id: 0887169EC9
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.954,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: Sat, 20 Apr 2019 16:43:25 -0000


> On Apr 20, 2019, at 9:38 AM, John Baldwin  wrote:
>=20
> On 4/20/19 9:32 AM, Enji Cooper wrote:
>>=20
>>> On Apr 20, 2019, at 9:31 AM, Enji Cooper  =
wrote:
>>>=20
>>>=20
>>>> On Apr 20, 2019, at 9:30 AM, John Baldwin > wrote:
>>>>=20
>>>> On 4/20/19 8:43 AM, Enji Cooper wrote:
>>>>> Author: ngie
>>>>> Date: Sat Apr 20 15:43:28 2019
>>>>> New Revision: 346443
>>>>> URL: https://svnweb.freebsd.org/changeset/base/346443 =

>>>>>=20
>>>>> Log:
>>>>> tests/sys/opencrypto: fix whitespace per PEP8
>>>>>=20
>>>>> Replace hard tabs with four-character indentations, per PEP8.
>>>>>=20
>>>>> This is being done to separate stylistic changes from the tests =
from functional
>>>>> ones, as I accidentally introduced a bug to the tests when I used =
four-space
>>>>> indentation locally.
>>>>>=20
>>>>> No functional change.
>>>>=20
>>>> Wow, this is really painful for the 4-5 open reviews I have =
outstanding as it
>>>> makes a merge disaster.
>>>=20
>>> Sorry ;_;=E2=80=A6
>>=20
>> 	Being more constructive: I will back out the change, then =
reapply it later.
>> Thank you,
>=20
> Ok, is it easy to reapply using a script or some such?  Also, in =
general I do prefer
> this indentation as 1) it works out of the box in emacs, and 2) many =
of the lines in
> cryptotest.py especially are indented pretty far over making it hard =
to read.

	Yeah. I basically did `%s/	/.   /g` in vim :). Backed out =
via r346452.
	Using hard tabs in python should really be verboten, except when =
dealing with docstrings, etc. It=E2=80=99s so easy to screw up =
programs/introduce dead code by not indenting things consistently with =
four-space indents.
Thanks!
-Enji=

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:44:07 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE28C156CD4E;
 Sat, 20 Apr 2019 16:44:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "smtp.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4DDAB6A01D;
 Sat, 20 Apr 2019 16:44:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from John-Baldwins-MacBook-Pro-3.local (unknown
 [IPv6:2601:648:8880:1e30:fd9b:9ce6:c8c:cc0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client did not present a certificate) (Authenticated sender: jhb)
 by smtp.freebsd.org (Postfix) with ESMTPSA id 979EB1CDA0;
 Sat, 20 Apr 2019 16:44:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Justin Hibbits , Alan Somers 
Cc: src-committers ,
 svn-src-all ,
 svn-src-head 
References: <201904201251.x3KCp6it044898@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: <5bf4a702-7df8-5597-25b0-55baa71d1d4f@FreeBSD.org>
Date: Sat, 20 Apr 2019 09:44:05 -0700
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0)
 Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: 
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Rspamd-Queue-Id: 4DDAB6A01D
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.92 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.92)[-0.919,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: Sat, 20 Apr 2019 16:44:07 -0000

On 4/20/19 6:23 AM, Justin Hibbits wrote:
> On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> 
>> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
>> wrote:
>>>
>>>
>>>
>>> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
>>>>
>>>> Author: asomers
>>>> Date: Sat Apr 20 12:51:05 2019
>>>> New Revision: 346441
>>>> URL: https://svnweb.freebsd.org/changeset/base/346441
>>>>
>>>> Log:
>>>>   Use symlinks for kernel modules rather than hardlinks
>>>>
>>>>   When aliasing a kernel module to a different name (ie if_igb for
>> if_em),
>>>>   it's better to use symlinks than hard links. kldxref will omit
>> entries for
>>>>   the links, ensuring that the loaded module has the correct name.
>>>>
>>>>
>>>
>>>
>>> Thanks! This should fix installkernel on my POWER9.
>>>
>>> - Justin
>>
>> What's the problem with your POWER9?  Is that one of those msdosfs
>> /boot systems?  If so, I don't think this will fix it.  msdosfs
>> doesn't support either symlinks or hardlinks.  Or is there some other
>> problem?
>> -Alan
>>
> 
> Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> msdosfs, but on second thought not sure how well would do that.

You could just use cp instead of a link?

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:46:06 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2006156CE23;
 Sat, 20 Apr 2019 16:46:06 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com
 [IPv6:2607:f8b0:4864:20::644])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 12C9B6A1C3;
 Sat, 20 Apr 2019 16:46:06 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pl1-x644.google.com with SMTP id w24so3928400plp.2;
 Sat, 20 Apr 2019 09:46:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=et/WDaE9VejSd9fMpWofVO9JkylLNVoauPZuYRG8uuI=;
 b=tVNBxPmCK4dKoMspw8HV64F9CWiCnx0jcR5ptdaaEgn+EiTCa98PuBSwTvXheo0K0d
 KLwU1Q1LAdy1p6A9hCjthdU8xRQIVonDePP02RnnXwLNTsJh/tMtDboPQXGllek5kKgA
 k9kyCC+SOG+KerevRx2EXFctlbCzZoaxozDxQ0GulneKn8KNT5h17JlEiUmYe77y+4dy
 Jhp4ZAoN3dN/VDwdRKPrIRskjAiDOrhFgvDpySzaOzJq/e8xg0mmwqQZRScj9o65TY1K
 tK63g55UjqljgFBs2BFbazEucAuF61K2ZVWT0KZ+jQCLwBm6UC/jEs/YnOfOUI4kWDG/
 iZlw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=et/WDaE9VejSd9fMpWofVO9JkylLNVoauPZuYRG8uuI=;
 b=NkN/mpazK4bDpmHsnoSJKyF3p/f7iMYS4U8C4qZRiApgmGPXK4ND2CohjqEQmPBtoq
 lAbZIugntmgxpt0cLcpfQVlPO1JCO+YHngeDWOrsuDjaWy9fFNRslJDzR7LwdO7+ybDg
 8cmCohWDyQm86ltujl6AnNebxL+XTjSUxf4ODMgdh6UYYn0KYbhqLjyv/0/ukDB200uf
 SISh+vTqzMAGIuDu4DETe3XEYdoJapqkzfmJ0el27nf5YVC8JLinr61LM/zg1nkwxq15
 geF4nJ1mCfOn8+vBe86aO8rwBJM/XqIZwnKAIQN6wWazsHo/IdXO7uXx26BU/DH6raPy
 QP8g==
X-Gm-Message-State: APjAAAUlJ+phm2W5aIWGOIO5KA7fum/zOx/4gjuQIzkgSZHb5wzrDMG9
 pCGGtBFLJZE1mb2FXOQIEQQgufSU8yg=
X-Google-Smtp-Source: APXvYqwV2+WfRW/nR+bo9r9hi93KcxDvHNeFRJofVGr88zb907icFO96ol+hhm4EDaRCzbV7qXPfoQ==
X-Received: by 2002:a17:902:407:: with SMTP id 7mr10513321ple.62.1555778764819; 
 Sat, 20 Apr 2019 09:46:04 -0700 (PDT)
Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id a10sm10559468pfc.21.2019.04.20.09.46.04
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 20 Apr 2019 09:46:04 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
From: Enji Cooper 
In-Reply-To: <5bf4a702-7df8-5597-25b0-55baa71d1d4f@FreeBSD.org>
Date: Sat, 20 Apr 2019 09:46:03 -0700
Cc: Justin Hibbits , Alan Somers ,
 src-committers ,
 svn-src-all ,
 svn-src-head 
Content-Transfer-Encoding: 7bit
Message-Id: <16BC7A31-39F3-4CFE-A6DA-5187FB154FA4@gmail.com>
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
 
 <5bf4a702-7df8-5597-25b0-55baa71d1d4f@FreeBSD.org>
To: John Baldwin 
X-Mailer: Apple Mail (2.3445.102.3)
X-Rspamd-Queue-Id: 12C9B6A1C3
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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[];
 NEURAL_HAM_SHORT(-0.95)[-0.953,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, 20 Apr 2019 16:46:06 -0000



> On Apr 20, 2019, at 9:44 AM, John Baldwin  wrote:
> 
> On 4/20/19 6:23 AM, Justin Hibbits wrote:
>> On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
>> 
>>> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
>>> wrote:
>>>> 
>>>> 
>>>> 
>>>> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
>>>>> 
>>>>> Author: asomers
>>>>> Date: Sat Apr 20 12:51:05 2019
>>>>> New Revision: 346441
>>>>> URL: https://svnweb.freebsd.org/changeset/base/346441
>>>>> 
>>>>> Log:
>>>>>  Use symlinks for kernel modules rather than hardlinks
>>>>> 
>>>>>  When aliasing a kernel module to a different name (ie if_igb for
>>> if_em),
>>>>>  it's better to use symlinks than hard links. kldxref will omit
>>> entries for
>>>>>  the links, ensuring that the loaded module has the correct name.
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> Thanks! This should fix installkernel on my POWER9.
>>>> 
>>>> - Justin
>>> 
>>> What's the problem with your POWER9?  Is that one of those msdosfs
>>> /boot systems?  If so, I don't think this will fix it.  msdosfs
>>> doesn't support either symlinks or hardlinks.  Or is there some other
>>> problem?
>>> -Alan
>>> 
>> 
>> Yes it is.  Well that's a bummer then. I thought we faked symlinks on
>> msdosfs, but on second thought not sure how well would do that.
> 
> You could just use cp instead of a link?

*eyes `install -l`*:

     -l linkflags
             Instead of copying the file make a link to the source.  The type
             of the link is determined by the linkflags argument.  Valid
             linkflags are: a (absolute), r (relative), h (hard), s
             (symbolic), m (mixed).  Absolute and relative have effect only
             for symbolic links.  Mixed links are hard links for files on the
             same filesystem, symbolic otherwise.

Cheers,
-Enji

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:54:32 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BAF71570116;
 Sat, 20 Apr 2019 16:54:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from smtp.freebsd.org (smtp.freebsd.org
 [IPv6:2610:1c1:1:606c::24b:4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "smtp.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 16C176A710;
 Sat, 20 Apr 2019 16:54:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from John-Baldwins-MacBook-Pro-3.local (unknown
 [IPv6:2601:648:8880:1e30:fd9b:9ce6:c8c:cc0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client did not present a certificate) (Authenticated sender: jhb)
 by smtp.freebsd.org (Postfix) with ESMTPSA id 546EC1CEB4;
 Sat, 20 Apr 2019 16:54:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto
To: Enji Cooper 
Cc: Enji Cooper , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <201904201543.x3KFhSAl037969@repo.freebsd.org>
 
 
 
 <3dc61795-3802-513e-93ff-3d6493eabe36@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: 
Date: Sat, 20 Apr 2019 09:54:29 -0700
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0)
 Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: 
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 16C176A710
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.92 / 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.92)[-0.919,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, 20 Apr 2019 16:54:32 -0000

On 4/20/19 9:43 AM, Enji Cooper wrote:
> 
>> On Apr 20, 2019, at 9:38 AM, John Baldwin  wrote:
>>
>> On 4/20/19 9:32 AM, Enji Cooper wrote:
>>>
>>>> On Apr 20, 2019, at 9:31 AM, Enji Cooper  wrote:
>>>>
>>>>
>>>>> On Apr 20, 2019, at 9:30 AM, John Baldwin > wrote:
>>>>>
>>>>> On 4/20/19 8:43 AM, Enji Cooper wrote:
>>>>>> Author: ngie
>>>>>> Date: Sat Apr 20 15:43:28 2019
>>>>>> New Revision: 346443
>>>>>> URL: https://svnweb.freebsd.org/changeset/base/346443 
>>>>>>
>>>>>> Log:
>>>>>> tests/sys/opencrypto: fix whitespace per PEP8
>>>>>>
>>>>>> Replace hard tabs with four-character indentations, per PEP8.
>>>>>>
>>>>>> This is being done to separate stylistic changes from the tests from functional
>>>>>> ones, as I accidentally introduced a bug to the tests when I used four-space
>>>>>> indentation locally.
>>>>>>
>>>>>> No functional change.
>>>>>
>>>>> Wow, this is really painful for the 4-5 open reviews I have outstanding as it
>>>>> makes a merge disaster.
>>>>
>>>> Sorry ;_;…
>>>
>>> 	Being more constructive: I will back out the change, then reapply it later.
>>> Thank you,
>>
>> Ok, is it easy to reapply using a script or some such?  Also, in general I do prefer
>> this indentation as 1) it works out of the box in emacs, and 2) many of the lines in
>> cryptotest.py especially are indented pretty far over making it hard to read.
> 
> 	Yeah. I basically did `%s/	/.   /g` in vim :). Backed out via r346452.
> 	Using hard tabs in python should really be verboten, except when dealing with docstrings, etc. It’s so easy to screw up programs/introduce dead code by not indenting things consistently with four-space indents.

To be clear, I prefer the _new_ indentation.  I kept having to go back and manually
use tabify in emacs to work with the current scripts, so once my pending stuff is
drained I will appreciate having it converted.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Sat Apr 20 16:55:28 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3526C15701A3;
 Sat, 20 Apr 2019 16:55:28 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com
 [IPv6:2607:f8b0:4864:20::529])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id A567C6A92A;
 Sat, 20 Apr 2019 16:55:27 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: by mail-pg1-x529.google.com with SMTP id z9so3962283pgu.10;
 Sat, 20 Apr 2019 09:55:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:message-id:mime-version:subject:date:in-reply-to:cc:to
 :references; bh=sASggUo89jBK+Eh6XGv/6wbM4wV35aDhJdVc+aX9NQo=;
 b=TYeT3q47n0b/iVdBg/x1knBb9bnXU797nBPS5zEFZ8qin8RoQbhc/DOwig6jsAkWxb
 /WCySk2seIp7ry6NY48947v1eVTTcDLoJlvxWhxLkfHsHJythFeKB4x8g325hKusN7+s
 mmE1i15uDnCyYbHDDZArJ6nK1Uu5ztOx1dlphn4TJ38CjC+fEHUi2WjNquvW5N1SkitD
 C8oZ5bYoOvizf6o32X4uOjGE0VaMuAvDUgbmhJBuxEfXEqK02PmJyXsKgWskERyKA6MY
 gDnzAT1zr+w290fTbWhBxLvHg/W7AqW5747k+5aBZ49grt6qhydf8Amr5aDmepONv8A/
 NDnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:message-id:mime-version:subject:date
 :in-reply-to:cc:to:references;
 bh=sASggUo89jBK+Eh6XGv/6wbM4wV35aDhJdVc+aX9NQo=;
 b=ZefkI2PlmWUxaL0Xp2vqk12Be3p2l/Y0WpyMQi75Z9aSdrbOxRpcbL8qvtmv7sAupx
 1vY91fsxRrCswl8vEiK6HK0g2lPS+Ap6h2nJ4Iwv+s9fm273s+xsBsYFFwbwXoaR01eR
 sMJynBqqZvPB99k4W93GTMGMJbXFkhUdizf4ytf4YBivxbJIcgKYZGjG/mlxe0nkX+1H
 omB3IrB91xzUzQDra2w2ssFz0eE5ElXgag620DT268XFYvshnnmcOOSo9H/im8d8hYgx
 uCmFY9Cu979eNCzC59fDqWn933sLu+jW8lqy1U/3ces58xDHGCeLMZ0okngSIKCNZ3sZ
 BKLg==
X-Gm-Message-State: APjAAAWVRlaYuh9U0ns4L+DuDfWr3jDaoufYb2Kw02mPCIiR0UZVblnu
 hx7k/SBbzgPiDj5vR+HkvcbsGKJACJE=
X-Google-Smtp-Source: APXvYqwlT0cR75em8qcP2ZC1SoJL8WtgPdHN6PJAB+CBhLfoTmIA0ApJsVdYVtrgdz2Zl0ICv9I0nA==
X-Received: by 2002:a63:c54e:: with SMTP id g14mr9951534pgd.265.1555779326365; 
 Sat, 20 Apr 2019 09:55:26 -0700 (PDT)
Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net.
 [73.19.52.228])
 by smtp.gmail.com with ESMTPSA id l88sm13498323pfb.104.2019.04.20.09.55.25
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 20 Apr 2019 09:55:25 -0700 (PDT)
From: Enji Cooper 
Message-Id: 
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Subject: Re: svn commit: r346443 - head/tests/sys/opencrypto
Date: Sat, 20 Apr 2019 09:55:25 -0700
In-Reply-To: 
Cc: Enji Cooper , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
To: John Baldwin 
References: <201904201543.x3KFhSAl037969@repo.freebsd.org>
 
 
 
 <3dc61795-3802-513e-93ff-3d6493eabe36@FreeBSD.org>
 
 
X-Mailer: Apple Mail (2.3445.102.3)
X-Rspamd-Queue-Id: A567C6A92A
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.954,0]; REPLY(-4.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
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: Sat, 20 Apr 2019 16:55:28 -0000


> On Apr 20, 2019, at 9:54 AM, John Baldwin  wrote:

=E2=80=A6

> To be clear, I prefer the _new_ indentation.  I kept having to go back =
and manually
> use tabify in emacs to work with the current scripts, so once my =
pending stuff is
> drained I will appreciate having it converted.

I figured as much, but really appreciate the clarification <3!
-Enji=

From owner-svn-src-head@freebsd.org  Sat Apr 20 17:21:31 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 612FB1570F0F
 for ;
 Sat, 20 Apr 2019 17:21:31 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com
 [IPv6:2607:f8b0:4864:20::843])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E6ADE6B7D4
 for ; Sat, 20 Apr 2019 17:21:30 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: by mail-qt1-x843.google.com with SMTP id p20so8326278qtc.9
 for ; Sat, 20 Apr 2019 10:21:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=bsdimp-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=IhcjqT7SeBivVK2akebdc9fY+WxgWpBHqy0jy3UIBCc=;
 b=SuvU5rItIQBQDA2j58az8IqN0cfidLmzeviZtvAdRRvPMPW5II1joSboboqW1pPAp2
 Lz2g2DqzDcxUv0qIa5aObIYj2Rydb8xUdcTvZFhsKFxaQXhiKYZQdW/Uzt8f9MpUwn9o
 KvGUL10/jKKuZDuKkrSrLbaMAuM+fUBYvjgwM9pSBxYrZ6vUmo0lELdZDDv8YJ4jSnip
 P23oI0shyDQvSNlijtsufeTraecBKnUzZAvD/2yDpZc0Nzo0v2Q53go3oCIxpAxWqGmr
 N50+Z78hxt0S8iAIu+QUrDI1wtPECPmC9xuYPNOj9k2IhjVeM3T0SKNjqKE3T7BMcJU3
 23Ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=IhcjqT7SeBivVK2akebdc9fY+WxgWpBHqy0jy3UIBCc=;
 b=EGTidUxdzluN/bO5M9mFFv6Abnhc2Btm0z8C7NtGjAOmKVEr0w0LMx5IdSi0VBF2Or
 vMt+Xrzj2Pqdqq27nlQEsVWMSLQCj5TOsh1C8s8cJGgq0dIyAtgCVSq2eaYmwGKZzz2f
 o3F1XMbnh4VBzL2mx+pcbc29llmhDYkdwSPXGTZ0u7X8ZNoFLR35tzSJIWyJBUFPU7bf
 YeV9bLHroIYWb/VXT/M22JXEjAflvLgc+/wU75+a/7hPxiTW5z4Nr1tkHvIy3Ewf5Gec
 UP+Dbu7xWSVAkC7ESRIAQZtY7gOcOEe1jdLZCFELMe1n10P2oGI4UYEI6czMe9x462qW
 twSA==
X-Gm-Message-State: APjAAAWfbXTxJTOPv/d6FQiMTxirbLWxT0aHN2IERHeHyaBj7EeAH7uJ
 5+2yhPNtsQ24iDM0Wf7dtXT4mz8T97QRXGPXr1t2gg==
X-Google-Smtp-Source: APXvYqwcG1IQcocCUU0X9YOV4lf67+WJ2qu066mYeEL3noE62fvJB5bMFxZ9XOpMGKwC7gYg+2qurC3+koJABilsGc0=
X-Received: by 2002:ac8:1aec:: with SMTP id h41mr8358308qtk.345.1555780890324; 
 Sat, 20 Apr 2019 10:21:30 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
 
 <5bf4a702-7df8-5597-25b0-55baa71d1d4f@FreeBSD.org>
In-Reply-To: <5bf4a702-7df8-5597-25b0-55baa71d1d4f@FreeBSD.org>
From: Warner Losh 
Date: Sat, 20 Apr 2019 11:21:16 -0600
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: John Baldwin 
Cc: Justin Hibbits , Alan Somers , 
 src-committers ,
 svn-src-all , 
 svn-src-head 
X-Rspamd-Queue-Id: E6ADE6B7D4
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.94 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.94)[-0.940,0]; REPLY(-4.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,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: Sat, 20 Apr 2019 17:21:31 -0000

On Sat, Apr 20, 2019, 10:44 AM John Baldwin  wrote:

> On 4/20/19 6:23 AM, Justin Hibbits wrote:
> > On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> >
> >> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> >> wrote:
> >>>
> >>>
> >>>
> >>> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> >>>>
> >>>> Author: asomers
> >>>> Date: Sat Apr 20 12:51:05 2019
> >>>> New Revision: 346441
> >>>> URL: https://svnweb.freebsd.org/changeset/base/346441
> >>>>
> >>>> Log:
> >>>>   Use symlinks for kernel modules rather than hardlinks
> >>>>
> >>>>   When aliasing a kernel module to a different name (ie if_igb for
> >> if_em),
> >>>>   it's better to use symlinks than hard links. kldxref will omit
> >> entries for
> >>>>   the links, ensuring that the loaded module has the correct name.
> >>>>
> >>>>
> >>>
> >>>
> >>> Thanks! This should fix installkernel on my POWER9.
> >>>
> >>> - Justin
> >>
> >> What's the problem with your POWER9?  Is that one of those msdosfs
> >> /boot systems?  If so, I don't think this will fix it.  msdosfs
> >> doesn't support either symlinks or hardlinks.  Or is there some other
> >> problem?
> >> -Alan
> >>
> >
> > Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> > msdosfs, but on second thought not sure how well would do that.
>
> You could just use cp instead of a link?
>

I don't think this solves the original issue.

Warner

-- 
> John Baldwin
>
>

From owner-svn-src-head@freebsd.org  Sat Apr 20 17:23:07 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820751570F92
 for ;
 Sat, 20 Apr 2019 17:23:07 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com
 [IPv6:2607:f8b0:4864:20::832])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 14F486B9C9
 for ; Sat, 20 Apr 2019 17:23:07 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: by mail-qt1-x832.google.com with SMTP id d13so8343777qth.5
 for ; Sat, 20 Apr 2019 10:23:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=bsdimp-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=RkbNjvsXqcX+2/uBp8aX4R2YBGfjox9I/Og+lVXD4lM=;
 b=fWpdXHoLkkboTsd8Q7WTGvr0VPfr51bpV5jczFbM0WC6Ke5/hBH2XbD0tZiX9D7YCt
 0PlCKG1cRm1ODRaJeiAHbdsazX+Ez2I0g3nVWcTnhYpggn582Ib9iW5KWy1i6dcTqzJ+
 8sRuL7T9f69p/+/lC/YdieSiuyR+mvywimbAfXgWBZW903h23kZxuoEJhe5N34dL3WSp
 zCq+WPEeQJrcqaOz8POrFF+ESMLVkaXNjV/aUN6B15pnKVwr9QSEVqckqSDD+EM7HFDL
 1b8urznsp3Z1DrktniibBZMryk6afWnVeVCIKfG/eaNkz9XzL2MPiJIMr7Tycnz7W7Sz
 +2uA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=RkbNjvsXqcX+2/uBp8aX4R2YBGfjox9I/Og+lVXD4lM=;
 b=PxT3YODkCW6K/OQwbvfs1n8nA/qYcuYo+xn/9G94GwskoM8RpIYfuJYhWaOE08R89G
 PvhiqC7YkBbhA8XZCftcG1WvCVK6JpyKEoNSFJyYJRKS/6BBnqgZvd9L++skokhUN1L6
 waupd0AHQSjwJDmbYJ4YOr9hZ6OwjdeNQ3XA3f6JgqplNKYnscpYJVsi+Xtz/iloVxGf
 XHzEZzD77umWVjP/OBumxkJmsU4m67EJidBA4tXkuMdnQWRclzh5h+XlH4qA9rf4WmgL
 Bwm/8GdOb2j8eSH71ytUEV1uRDNSSfbnW5GDO9tSicSnqohPmKG6edGQZXj4waOOxgol
 C/3g==
X-Gm-Message-State: APjAAAXpFBCDOX2rkX81Ok4Bi6RNptYch5mL6pzKVDi9pxhQbgoJcNZ0
 wZ1uTdWZy04b9pFqM9ynCQqjRvzL8ck5vqARi8y/fw==
X-Google-Smtp-Source: APXvYqxE7L+RFUhuptMvfiINdkWNV6SYYi4JS35NAkCh1ssbKdTxorab3hwu1fjz4Sp6wIImO7A1pJ5joAJ91feWrh0=
X-Received: by 2002:ac8:1e0c:: with SMTP id n12mr2779062qtl.33.1555780986533; 
 Sat, 20 Apr 2019 10:23:06 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
 
 <5bf4a702-7df8-5597-25b0-55baa71d1d4f@FreeBSD.org>
 <16BC7A31-39F3-4CFE-A6DA-5187FB154FA4@gmail.com>
In-Reply-To: <16BC7A31-39F3-4CFE-A6DA-5187FB154FA4@gmail.com>
From: Warner Losh 
Date: Sat, 20 Apr 2019 11:22:54 -0600
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Garrett Cooper 
Cc: John Baldwin , Justin Hibbits , 
 Alan Somers , src-committers ,
 svn-src-all , svn-src-head 
X-Rspamd-Queue-Id: 14F486B9C9
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.94 / 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.94)[-0.940,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: Sat, 20 Apr 2019 17:23:07 -0000

On Sat, Apr 20, 2019, 10:46 AM Enji Cooper  wrote:

>
>
> > On Apr 20, 2019, at 9:44 AM, John Baldwin  wrote:
> >
> > On 4/20/19 6:23 AM, Justin Hibbits wrote:
> >> On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> >>
> >>> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> >>> wrote:
> >>>>
> >>>>
> >>>>
> >>>> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> >>>>>
> >>>>> Author: asomers
> >>>>> Date: Sat Apr 20 12:51:05 2019
> >>>>> New Revision: 346441
> >>>>> URL: https://svnweb.freebsd.org/changeset/base/346441
> >>>>>
> >>>>> Log:
> >>>>>  Use symlinks for kernel modules rather than hardlinks
> >>>>>
> >>>>>  When aliasing a kernel module to a different name (ie if_igb for
> >>> if_em),
> >>>>>  it's better to use symlinks than hard links. kldxref will omit
> >>> entries for
> >>>>>  the links, ensuring that the loaded module has the correct name.
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> Thanks! This should fix installkernel on my POWER9.
> >>>>
> >>>> - Justin
> >>>
> >>> What's the problem with your POWER9?  Is that one of those msdosfs
> >>> /boot systems?  If so, I don't think this will fix it.  msdosfs
> >>> doesn't support either symlinks or hardlinks.  Or is there some other
> >>> problem?
> >>> -Alan
> >>>
> >>
> >> Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> >> msdosfs, but on second thought not sure how well would do that.
> >
> > You could just use cp instead of a link?
>
> *eyes `install -l`*:
>
>      -l linkflags
>              Instead of copying the file make a link to the source.  The
> type
>              of the link is determined by the linkflags argument.  Valid
>              linkflags are: a (absolute), r (relative), h (hard), s
>              (symbolic), m (mixed).  Absolute and relative have effect only
>              for symbolic links.  Mixed links are hard links for files on
> the
>              same filesystem, symbolic otherwise.
>

None of those are helpful. Better to just not do the link for a system we
don't the compat links for....

Warner

Cheers,
> -Enji
>
>

From owner-svn-src-head@freebsd.org  Sat Apr 20 18:59:43 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A24861572E08;
 Sat, 20 Apr 2019 18:59:43 +0000 (UTC)
 (envelope-from freebsd@gndrsh.dnsmgr.net)
Received: from gndrsh.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 EEF966E0CF;
 Sat, 20 Apr 2019 18:59:42 +0000 (UTC)
 (envelope-from freebsd@gndrsh.dnsmgr.net)
Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1])
 by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3KIxdwf023813;
 Sat, 20 Apr 2019 11:59:39 -0700 (PDT)
 (envelope-from freebsd@gndrsh.dnsmgr.net)
Received: (from freebsd@localhost)
 by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3KIxd9J023812;
 Sat, 20 Apr 2019 11:59:39 -0700 (PDT) (envelope-from freebsd)
From: "Rodney W. Grimes" 
Message-Id: <201904201859.x3KIxd9J023812@gndrsh.dnsmgr.net>
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
In-Reply-To: 
To: Warner Losh 
Date: Sat, 20 Apr 2019 11:59:39 -0700 (PDT)
CC: Alan Somers , Justin Hibbits , 
 src-committers ,
 svn-src-all ,
 svn-src-head 
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: EEF966E0CF
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.85 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.85)[-0.847,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: Sat, 20 Apr 2019 18:59:43 -0000

> On Sat, Apr 20, 2019, 7:47 AM Alan Somers  wrote:
> 
> > On Sat, Apr 20, 2019 at 7:23 AM Justin Hibbits 
> > wrote:
> > >
> > >
> > >
> > > On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> > >>
> > >> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> > wrote:
> > >> >
> > >> >
> > >> >
> > >> > On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> > >> >>
> > >> >> Author: asomers
> > >> >> Date: Sat Apr 20 12:51:05 2019
> > >> >> New Revision: 346441
> > >> >> URL: https://svnweb.freebsd.org/changeset/base/346441
> > >> >>
> > >> >> Log:
> > >> >>   Use symlinks for kernel modules rather than hardlinks
> > >> >>
> > >> >>   When aliasing a kernel module to a different name (ie if_igb for
> > if_em),
> > >> >>   it's better to use symlinks than hard links. kldxref will omit
> > entries for
> > >> >>   the links, ensuring that the loaded module has the correct name.
> > >> >>
> > >> >>
> > >> >
> > >> >
> > >> > Thanks! This should fix installkernel on my POWER9.
> > >> >
> > >> > - Justin
> > >>
> > >> What's the problem with your POWER9?  Is that one of those msdosfs
> > >> /boot systems?  If so, I don't think this will fix it.  msdosfs
> > >> doesn't support either symlinks or hardlinks.  Or is there some other
> > >> problem?
> > >> -Alan
> > >
> > >
> > > Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> > msdosfs, but on second thought not sure how well would do that.
> > >
> > > - Justin
> >
> > We should probably just remove the offending links on ppc, then.  The
> > only harm is that after upgrading, ppc users would have to replace
> > fuse_load="YES" with fusefs_load="YES".
> >
> 
> We should only do the Intel links on those platforms that have legacy users
> that need the old names. We should also only support the old names for one
> release or so.

IIRC this was done so that the dropping of one of the drivers in ^head
could be merged back to ^stable.  It probably should of been killed in
^head after that fact, but if I recall the values correctly it was
@head=12 and merged to @stable=11.  We would need to dig those facts
out, but yes, please, this link should be killed and cleaned up quickly as
it creates almost as many problems as it solved.
 
> Warner
-- 
Rod Grimes                                                 rgrimes@freebsd.org

From owner-svn-src-head@freebsd.org  Sat Apr 20 19:16:02 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28AA715732AF;
 Sat, 20 Apr 2019 19:16:02 +0000 (UTC)
 (envelope-from freebsd@gndrsh.dnsmgr.net)
Received: from gndrsh.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 6694D6E7F7;
 Sat, 20 Apr 2019 19:16:01 +0000 (UTC)
 (envelope-from freebsd@gndrsh.dnsmgr.net)
Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1])
 by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3KJFxjD023900;
 Sat, 20 Apr 2019 12:15:59 -0700 (PDT)
 (envelope-from freebsd@gndrsh.dnsmgr.net)
Received: (from freebsd@localhost)
 by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3KJFxp3023899;
 Sat, 20 Apr 2019 12:15:59 -0700 (PDT) (envelope-from freebsd)
From: "Rodney W. Grimes" 
Message-Id: <201904201915.x3KJFxp3023899@gndrsh.dnsmgr.net>
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
In-Reply-To: <201904201859.x3KIxd9J023812@gndrsh.dnsmgr.net>
To: rgrimes@freebsd.org
Date: Sat, 20 Apr 2019 12:15:59 -0700 (PDT)
CC: Warner Losh , Alan Somers ,
 Justin Hibbits ,
 src-committers ,
 svn-src-all ,
 svn-src-head 
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: 6694D6E7F7
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.86 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.86)[-0.863,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: Sat, 20 Apr 2019 19:16:02 -0000

> > On Sat, Apr 20, 2019, 7:47 AM Alan Somers  wrote:
> > 
> > > On Sat, Apr 20, 2019 at 7:23 AM Justin Hibbits 
> > > wrote:
> > > >
> > > >
> > > >
> > > > On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> > > >>
> > > >> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> > > wrote:
> > > >> >
> > > >> >
> > > >> >
> > > >> > On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> > > >> >>
> > > >> >> Author: asomers
> > > >> >> Date: Sat Apr 20 12:51:05 2019
> > > >> >> New Revision: 346441
> > > >> >> URL: https://svnweb.freebsd.org/changeset/base/346441
> > > >> >>
> > > >> >> Log:
> > > >> >>   Use symlinks for kernel modules rather than hardlinks
> > > >> >>
> > > >> >>   When aliasing a kernel module to a different name (ie if_igb for
> > > if_em),
> > > >> >>   it's better to use symlinks than hard links. kldxref will omit
> > > entries for
> > > >> >>   the links, ensuring that the loaded module has the correct name.
> > > >> >>
> > > >> >>
> > > >> >
> > > >> >
> > > >> > Thanks! This should fix installkernel on my POWER9.
> > > >> >
> > > >> > - Justin
> > > >>
> > > >> What's the problem with your POWER9?  Is that one of those msdosfs
> > > >> /boot systems?  If so, I don't think this will fix it.  msdosfs
> > > >> doesn't support either symlinks or hardlinks.  Or is there some other
> > > >> problem?
> > > >> -Alan
> > > >
> > > >
> > > > Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> > > msdosfs, but on second thought not sure how well would do that.
> > > >
> > > > - Justin
> > >
> > > We should probably just remove the offending links on ppc, then.  The
> > > only harm is that after upgrading, ppc users would have to replace
> > > fuse_load="YES" with fusefs_load="YES".
> > >
> > 
> > We should only do the Intel links on those platforms that have legacy users
> > that need the old names. We should also only support the old names for one
> > release or so.
> 
> IIRC this was done so that the dropping of one of the drivers in ^head
> could be merged back to ^stable.  It probably should of been killed in
> ^head after that fact, but if I recall the values correctly it was
> @head=12 and merged to @stable=11.  We would need to dig those facts
> out, but yes, please, this link should be killed and cleaned up quickly as
> it creates almost as many problems as it solved.

Ignore most of that I had mixed the other time we did kernel module
lnks (intel ethernet driver) with this insance for fuse.  Though the
principal idea of this should be a short lived compatibility hack still
applies.

> > Warner
> -- 
> Rod Grimes                                                 rgrimes@freebsd.org
-- 
Rod Grimes                                                 rgrimes@freebsd.org

From owner-svn-src-head@freebsd.org  Sat Apr 20 20:03:34 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEA781574989;
 Sat, 20 Apr 2019 20:03:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "smtp.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 62095700CF;
 Sat, 20 Apr 2019 20:03:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from John-Baldwins-MacBook-Pro-3.local (unknown
 [IPv6:2601:648:8880:1e30:9532:4c8d:399e:176b])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client did not present a certificate) (Authenticated sender: jhb)
 by smtp.freebsd.org (Postfix) with ESMTPSA id 7353B1E3B1;
 Sat, 20 Apr 2019 20:03:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: Warner Losh 
Cc: Justin Hibbits , Alan Somers , 
 src-committers ,
 svn-src-all ,
 svn-src-head 
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
 
 <5bf4a702-7df8-5597-25b0-55baa71d1d4f@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: 
Date: Sat, 20 Apr 2019 13:03:31 -0700
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0)
 Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: 
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Rspamd-Queue-Id: 62095700CF
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_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[];
 NEURAL_HAM_SHORT(-0.96)[-0.963,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, 20 Apr 2019 20:03:35 -0000

On 4/20/19 10:21 AM, Warner Losh wrote:
> On Sat, Apr 20, 2019, 10:44 AM John Baldwin  wrote:
> 
>> On 4/20/19 6:23 AM, Justin Hibbits wrote:
>>> On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
>>>
>>>> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
>>>>>>
>>>>>> Author: asomers
>>>>>> Date: Sat Apr 20 12:51:05 2019
>>>>>> New Revision: 346441
>>>>>> URL: https://svnweb.freebsd.org/changeset/base/346441
>>>>>>
>>>>>> Log:
>>>>>>   Use symlinks for kernel modules rather than hardlinks
>>>>>>
>>>>>>   When aliasing a kernel module to a different name (ie if_igb for
>>>> if_em),
>>>>>>   it's better to use symlinks than hard links. kldxref will omit
>>>> entries for
>>>>>>   the links, ensuring that the loaded module has the correct name.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> Thanks! This should fix installkernel on my POWER9.
>>>>>
>>>>> - Justin
>>>>
>>>> What's the problem with your POWER9?  Is that one of those msdosfs
>>>> /boot systems?  If so, I don't think this will fix it.  msdosfs
>>>> doesn't support either symlinks or hardlinks.  Or is there some other
>>>> problem?
>>>> -Alan
>>>>
>>>
>>> Yes it is.  Well that's a bummer then. I thought we faked symlinks on
>>> msdosfs, but on second thought not sure how well would do that.
>>
>> You could just use cp instead of a link?
>>
> 
> I don't think this solves the original issue.

FWIW, I think igb and em still use separate driver_t's with separate
probe tables, etc. to preserve POLA of existing device names, so in
theory there could still be two modules, it's just by choice that they
are both in the same C file and same kld.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Sat Apr 20 20:29:04 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 847541574F15;
 Sat, 20 Apr 2019 20:29:04 +0000 (UTC) (envelope-from bde@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 22E5C70917;
 Sat, 20 Apr 2019 20:29:04 +0000 (UTC) (envelope-from bde@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EABB81B24F;
 Sat, 20 Apr 2019 20:29:03 +0000 (UTC) (envelope-from bde@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KKT3bA086903;
 Sat, 20 Apr 2019 20:29:03 GMT (envelope-from bde@FreeBSD.org)
Received: (from bde@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KKT3pB086901;
 Sat, 20 Apr 2019 20:29:03 GMT (envelope-from bde@FreeBSD.org)
Message-Id: <201904202029.x3KKT3pB086901@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org
 using -f
From: Bruce Evans 
Date: Sat, 20 Apr 2019 20:29:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346454 - head/lib/libvgl
X-SVN-Group: head
X-SVN-Commit-Author: bde
X-SVN-Commit-Paths: head/lib/libvgl
X-SVN-Commit-Revision: 346454
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 22E5C70917
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.96)[-0.965,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, 20 Apr 2019 20:29:04 -0000

Author: bde
Date: Sat Apr 20 20:29:03 2019
New Revision: 346454
URL: https://svnweb.freebsd.org/changeset/base/346454

Log:
  Make libvgl mostly work without superuser privilege in direct modes by
  not doing any unnecessary PIO instructions or refusing to start when the
  i/o privilege needed for these instructions cannot be acquired.
  
  This turns off useless palette management in direct modes.  Palette
  management had no useful effect since the hardware palette is not used
  in these modes.
  
  This transiently acquires i/o privilege if possible as needed to give
  VGLSetBorder() and VGLBlankDisplay() a chance of working.  Neither has
  much chance of working.  I was going to drop support for them in direct
  modes, but found that VGLBlankDisplay() still works with an old graphics
  card on a not so old LCD monitor.
  
  This has some good side effects: reduce glitches for managing the palette
  for screen switches, and speed up and reduce async-signal-unsafeness in
  mouse cursor drawing.

Modified:
  head/lib/libvgl/main.c
  head/lib/libvgl/mouse.c
  head/lib/libvgl/simple.c

Modified: head/lib/libvgl/main.c
==============================================================================
--- head/lib/libvgl/main.c	Sat Apr 20 17:16:36 2019	(r346453)
+++ head/lib/libvgl/main.c	Sat Apr 20 20:29:03 2019	(r346454)
@@ -93,7 +93,8 @@ struct vt_mode smode;
     size[2] = VGLOldVInfo.font_size;;
     ioctl(0, KDRASTER, size);
   }
-  ioctl(0, KDDISABIO, 0);
+  if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+    ioctl(0, KDDISABIO, 0);
   ioctl(0, KDSETMODE, KD_TEXT);
   smode.mode = VT_AUTO;
   ioctl(0, VT_SETMODE, &smode);
@@ -176,7 +177,7 @@ VGLInit(int mode)
   if (VGLDisplay == NULL)
     return -2;
 
-  if (ioctl(0, KDENABIO, 0)) {
+  if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0)) {
     free(VGLDisplay);
     return -3;
   }
@@ -370,7 +371,8 @@ VGLCheckSwitch()
 
     VGLSwitchPending = 0;
     if (VGLOnDisplay) {
-      ioctl(0, KDENABIO, 0);
+      if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+        ioctl(0, KDENABIO, 0);
       ioctl(0, KDSETMODE, KD_GRAPHICS);
       ioctl(0, VGLMode, 0);
       VGLCurWindow = 0;
@@ -531,7 +533,8 @@ VGLCheckSwitch()
       munmap(VGLDisplay->Bitmap, VGLAdpInfo.va_window_size);
       ioctl(0, VGLOldMode, 0);
       ioctl(0, KDSETMODE, KD_TEXT);
-      ioctl(0, KDDISABIO, 0);
+      if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+        ioctl(0, KDDISABIO, 0);
       ioctl(0, VT_RELDISP, VT_TRUE);
       VGLDisplay->Bitmap = VGLBuf;
       VGLDisplay->Type = MEMBUF;

Modified: head/lib/libvgl/mouse.c
==============================================================================
--- head/lib/libvgl/mouse.c	Sat Apr 20 17:16:36 2019	(r346453)
+++ head/lib/libvgl/mouse.c	Sat Apr 20 20:29:03 2019	(r346454)
@@ -111,10 +111,12 @@ VGLMousePointerShow()
   if (!VGLMouseVisible) {
     INTOFF();
     VGLMouseVisible = 1;
-    crtcidx = inb(0x3c4);
-    crtcval = inb(0x3c5);
-    gdcidx = inb(0x3ce);
-    gdcval = inb(0x3cf);
+    if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+      crtcidx = inb(0x3c4);
+      crtcval = inb(0x3c5);
+      gdcidx = inb(0x3ce);
+      gdcval = inb(0x3cf);
+    }
     __VGLBitmapCopy(VGLDisplay, VGLMouseXpos, VGLMouseYpos, 
 		  &VGLMouseSave, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
     bcopy(VGLMouseSave.Bitmap, buffer.Bitmap,
@@ -128,10 +130,12 @@ VGLMousePointerShow()
       }
     __VGLBitmapCopy(&buffer, 0, 0, VGLDisplay, 
 		  VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
-    outb(0x3c4, crtcidx);
-    outb(0x3c5, crtcval);
-    outb(0x3ce, gdcidx);
-    outb(0x3cf, gdcval);
+    if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+      outb(0x3c4, crtcidx);
+      outb(0x3c5, crtcval);
+      outb(0x3ce, gdcidx);
+      outb(0x3cf, gdcval);
+    }
     INTON();
   }
 }
@@ -144,16 +148,20 @@ VGLMousePointerHide()
   if (VGLMouseVisible) {
     INTOFF();
     VGLMouseVisible = 0;
-    crtcidx = inb(0x3c4);
-    crtcval = inb(0x3c5);
-    gdcidx = inb(0x3ce);
-    gdcval = inb(0x3cf);
+    if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+      crtcidx = inb(0x3c4);
+      crtcval = inb(0x3c5);
+      gdcidx = inb(0x3ce);
+      gdcval = inb(0x3cf);
+    }
     __VGLBitmapCopy(&VGLMouseSave, 0, 0, VGLDisplay, 
 		  VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
-    outb(0x3c4, crtcidx);
-    outb(0x3c5, crtcval);
-    outb(0x3ce, gdcidx);
-    outb(0x3cf, gdcval);
+    if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+      outb(0x3c4, crtcidx);
+      outb(0x3c5, crtcval);
+      outb(0x3ce, gdcidx);
+      outb(0x3cf, gdcval);
+    }
     INTON();
   }
 }

Modified: head/lib/libvgl/simple.c
==============================================================================
--- head/lib/libvgl/simple.c	Sat Apr 20 17:16:36 2019	(r346453)
+++ head/lib/libvgl/simple.c	Sat Apr 20 20:29:03 2019	(r346454)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include "vgl.h"
 
@@ -551,6 +552,8 @@ VGLRestorePalette()
 {
   int i;
 
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+    return;
   outb(0x3C6, 0xFF);
   inb(0x3DA); 
   outb(0x3C8, 0x00);
@@ -571,6 +574,8 @@ VGLSavePalette()
 {
   int i;
 
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+    return;
   outb(0x3C6, 0xFF);
   inb(0x3DA);
   outb(0x3C7, 0x00);
@@ -591,6 +596,8 @@ VGLSetPalette(byte *red, byte *green, byte *blue)
 {
   int i;
   
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+    return;
   for (i=0; i<256; i++) {
     VGLSavePaletteRed[i] = red[i];
     VGLSavePaletteGreen[i] = green[i];
@@ -615,6 +622,8 @@ VGLSetPalette(byte *red, byte *green, byte *blue)
 void
 VGLSetPaletteIndex(byte color, byte red, byte green, byte blue)
 {
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+    return;
   VGLSavePaletteRed[color] = red;
   VGLSavePaletteGreen[color] = green;
   VGLSavePaletteBlue[color] = blue;
@@ -630,11 +639,15 @@ VGLSetPaletteIndex(byte color, byte red, byte green, b
 void
 VGLSetBorder(byte color)
 {
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0))
+    return;
   VGLCheckSwitch();
   inb(0x3DA);
   outb(0x3C0,0x11); outb(0x3C0, color); 
   inb(0x3DA);
   outb(0x3C0, 0x20);
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+    ioctl(0, KDDISABIO, 0);
 }
 
 void
@@ -642,7 +655,11 @@ VGLBlankDisplay(int blank)
 {
   byte val;
 
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0))
+    return;
   VGLCheckSwitch();
   outb(0x3C4, 0x01); val = inb(0x3C5); outb(0x3C4, 0x01);
   outb(0x3C5, ((blank) ? (val |= 0x20) : (val &= 0xDF)));
+  if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+    ioctl(0, KDDISABIO, 0);
 }

From owner-svn-src-head@freebsd.org  Sat Apr 20 21:00:45 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 086551575D29;
 Sat, 20 Apr 2019 21:00:45 +0000 (UTC)
 (envelope-from wulf@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 A4BDE71AA1;
 Sat, 20 Apr 2019 21:00:44 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FB0A1B76B;
 Sat, 20 Apr 2019 21:00:44 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KL0ivg005060;
 Sat, 20 Apr 2019 21:00:44 GMT (envelope-from wulf@FreeBSD.org)
Received: (from wulf@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KL0ikO005059;
 Sat, 20 Apr 2019 21:00:44 GMT (envelope-from wulf@FreeBSD.org)
Message-Id: <201904202100.x3KL0ikO005059@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: wulf set sender to
 wulf@FreeBSD.org using -f
From: Vladimir Kondratyev 
Date: Sat, 20 Apr 2019 21:00:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346455 - head/sys/dev/atkbdc
X-SVN-Group: head
X-SVN-Commit-Author: wulf
X-SVN-Commit-Paths: head/sys/dev/atkbdc
X-SVN-Commit-Revision: 346455
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: A4BDE71AA1
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)[-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: Sat, 20 Apr 2019 21:00:45 -0000

Author: wulf
Date: Sat Apr 20 21:00:44 2019
New Revision: 346455
URL: https://svnweb.freebsd.org/changeset/base/346455

Log:
  psm(4): Add support for 4 and 5 finger touches in synaptics driver
  
  While 4-th and 5-th finger positions are not exported through PS/2
  interface, total number of touches is reported by MT trackpads.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c	Sat Apr 20 20:29:03 2019	(r346454)
+++ head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:00:44 2019	(r346455)
@@ -1830,7 +1830,7 @@ psm_register_synaptics(device_t dev)
 	if (sc->synhw.capClickPad && sc->synhw.topButtonPad)
 		evdev_support_prop(evdev_a, INPUT_PROP_TOPBUTTONPAD);
 	evdev_support_key(evdev_a, BTN_TOUCH);
-	evdev_support_nfingers(evdev_a, 3);
+	evdev_support_nfingers(evdev_a, sc->synhw.capReportsV ? 5 : 3);
 	psm_support_abs_bulk(evdev_a, synaptics_absinfo_st);
 	if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV)
 		psm_support_abs_bulk(evdev_a, synaptics_absinfo_mt);
@@ -3212,6 +3212,7 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
 {
 	static int touchpad_buttons;
 	static int guest_buttons;
+	static int ew_finger_count;
 	static finger_t f[PSM_FINGERS];
 	int w, id, nfingers, ewcode, extended_buttons, clickpad_pressed;
 
@@ -3372,6 +3373,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
 					    (pb->ipacket[1] & 0x01)) + 8,
 					.flags = PSM_FINGER_FUZZY,
 				};
+			break;
+		case 2:
+			ew_finger_count = pb->ipacket[1] & 0x0f;
 		default:
 			break;
 		}
@@ -3379,6 +3383,11 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
 		goto SYNAPTICS_END;
 
 	case 1:
+		if (sc->synhw.capReportsV && ew_finger_count > 3) {
+			nfingers = ew_finger_count;
+			break;
+		}
+		/* FALLTHROUGH */
 	case 0:
 		nfingers = w + 2;
 		break;

From owner-svn-src-head@freebsd.org  Sat Apr 20 21:02:43 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF5931575F6D;
 Sat, 20 Apr 2019 21:02:42 +0000 (UTC)
 (envelope-from wulf@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 7244671E9F;
 Sat, 20 Apr 2019 21:02:42 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25F421B902;
 Sat, 20 Apr 2019 21:02:42 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KL2gjP007689;
 Sat, 20 Apr 2019 21:02:42 GMT (envelope-from wulf@FreeBSD.org)
Received: (from wulf@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KL2fZD007688;
 Sat, 20 Apr 2019 21:02:41 GMT (envelope-from wulf@FreeBSD.org)
Message-Id: <201904202102.x3KL2fZD007688@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: wulf set sender to
 wulf@FreeBSD.org using -f
From: Vladimir Kondratyev 
Date: Sat, 20 Apr 2019 21:02:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346456 - head/sys/dev/atkbdc
X-SVN-Group: head
X-SVN-Commit-Author: wulf
X-SVN-Commit-Paths: head/sys/dev/atkbdc
X-SVN-Commit-Revision: 346456
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 7244671E9F
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)[-1.000,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, 20 Apr 2019 21:02:43 -0000

Author: wulf
Date: Sat Apr 20 21:02:41 2019
New Revision: 346456
URL: https://svnweb.freebsd.org/changeset/base/346456

Log:
  psm(4): do not process gestures when palm is present
  
  Ignoring of gesture processing when the palm is detected helps to reduce
  some of the erratic pointer behavior.
  
  This fixes regression introduced in r317814
  
  Reported by:	Ben LeMasurier 
  MFC after:	2 weeks

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:00:44 2019	(r346455)
+++ head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:02:41 2019	(r346456)
@@ -3214,7 +3214,7 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
 	static int guest_buttons;
 	static int ew_finger_count;
 	static finger_t f[PSM_FINGERS];
-	int w, id, nfingers, ewcode, extended_buttons, clickpad_pressed;
+	int w, id, nfingers, palm, ewcode, extended_buttons, clickpad_pressed;
 
 	extended_buttons = 0;
 
@@ -3577,12 +3577,16 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, 
 
 	ms->button = touchpad_buttons;
 
-	psmgestures(sc, &f[0], nfingers, ms);
+	palm = psmpalmdetect(sc, &f[0], nfingers);
+
+	/* Palm detection doesn't terminate the current action. */
+	if (!palm)
+		psmgestures(sc, &f[0], nfingers, ms);
+
 	for (id = 0; id < PSM_FINGERS; id++)
 		psmsmoother(sc, &f[id], id, ms, x, y);
 
-	/* Palm detection doesn't terminate the current action. */
-	if (psmpalmdetect(sc, &f[0], nfingers)) {
+	if (palm) {
 		*x = *y = *z = 0;
 		ms->button = ms->obutton;
 		return (0);
@@ -4324,7 +4328,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m
 {
 	static int touchpad_button, trackpoint_button;
 	finger_t fn, f[ELANTECH_MAX_FINGERS];
-	int pkt, id, scale, i, nfingers, mask;
+	int pkt, id, scale, i, nfingers, mask, palm;
 
 	if (!elantech_support)
 		return (0);
@@ -4713,10 +4717,14 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m
 
 	ms->button = touchpad_button | trackpoint_button;
 
+	/* Palm detection doesn't terminate the current action. */
+	palm = psmpalmdetect(sc, &f[0], nfingers);
+
 	/* Send finger 1 position to gesture processor */
-	if (PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) ||
-	    nfingers == 0)
+	if ((PSM_FINGER_IS_SET(f[0]) || PSM_FINGER_IS_SET(f[1]) ||
+	    nfingers == 0) && !palm)
 		psmgestures(sc, &f[0], imin(nfingers, 3), ms);
+
 	/* Send fingers positions to movement smoothers */
 	for (id = 0; id < PSM_FINGERS; id++)
 		if (PSM_FINGER_IS_SET(f[id]) || !(mask & (1 << id)))
@@ -4731,8 +4739,7 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, m
 	}
 	sc->elanaction.mask = mask;
 
-	/* Palm detection doesn't terminate the current action. */
-	if (psmpalmdetect(sc, &f[0], nfingers)) {
+	if (palm) {
 		*x = *y = *z = 0;
 		ms->button = ms->obutton;
 		return (0);

From owner-svn-src-head@freebsd.org  Sat Apr 20 21:04:58 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 117DE157603A;
 Sat, 20 Apr 2019 21:04:58 +0000 (UTC)
 (envelope-from wulf@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 692867206B;
 Sat, 20 Apr 2019 21:04:57 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57DA41B903;
 Sat, 20 Apr 2019 21:04:57 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KL4vX9007826;
 Sat, 20 Apr 2019 21:04:57 GMT (envelope-from wulf@FreeBSD.org)
Received: (from wulf@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KL4uvl007824;
 Sat, 20 Apr 2019 21:04:56 GMT (envelope-from wulf@FreeBSD.org)
Message-Id: <201904202104.x3KL4uvl007824@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: wulf set sender to
 wulf@FreeBSD.org using -f
From: Vladimir Kondratyev 
Date: Sat, 20 Apr 2019 21:04:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346457 - in head: share/man/man4 sys/dev/atkbdc
X-SVN-Group: head
X-SVN-Commit-Author: wulf
X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/atkbdc
X-SVN-Commit-Revision: 346457
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 692867206B
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)[-1.000,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, 20 Apr 2019 21:04:58 -0000

Author: wulf
Date: Sat Apr 20 21:04:56 2019
New Revision: 346457
URL: https://svnweb.freebsd.org/changeset/base/346457

Log:
  psm(4): respect tap_disabled configuration with enabled Extended support
  
  This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps
  were processed.
  tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1).
  To respect PR kern/139272, taps are ignored only when explicity disabled.
  
  Submitted by:	Ben LeMasurier  (initial version)
  MFC after:	2 weeks

Modified:
  head/share/man/man4/psm.4
  head/sys/dev/atkbdc/psm.c

Modified: head/share/man/man4/psm.4
==============================================================================
--- head/share/man/man4/psm.4	Sat Apr 20 21:02:41 2019	(r346456)
+++ head/share/man/man4/psm.4	Sat Apr 20 21:04:56 2019	(r346457)
@@ -354,8 +354,8 @@ Tap and drag gestures can be disabled by setting
 to
 .Em 0
 at boot-time.
-Currently, this is only supported on Synaptics touchpads with Extended
-support disabled.
+Currently, this is supported on Synaptics touchpads regardless of Extended
+support state and on Elantech touchpads with Extended support enabled.
 The behaviour may be changed after boot by setting
 the sysctl with the same name and by restarting
 .Xr moused 8

Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:02:41 2019	(r346456)
+++ head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:04:56 2019	(r346457)
@@ -3820,9 +3820,15 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i
 			gest->in_vscroll = 0;
 
 			/* Compute tap timeout. */
-			gest->taptimeout.tv_sec  = tap_timeout / 1000000;
-			gest->taptimeout.tv_usec = tap_timeout % 1000000;
-			timevaladd(&gest->taptimeout, &sc->lastsoftintr);
+			if (tap_enabled != 0) {
+				gest->taptimeout = (struct timeval) {
+					.tv_sec  = tap_timeout / 1000000,
+					.tv_usec = tap_timeout % 1000000,
+				};
+				timevaladd(
+				    &gest->taptimeout, &sc->lastsoftintr);
+			} else
+				timevalclear(&gest->taptimeout);
 
 			sc->flags |= PSM_FLAGS_FINGERDOWN;
 

From owner-svn-src-head@freebsd.org  Sat Apr 20 21:06:13 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3605B1576118;
 Sat, 20 Apr 2019 21:06:13 +0000 (UTC)
 (envelope-from wulf@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 D0BC0721D5;
 Sat, 20 Apr 2019 21:06:12 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABB0A1B905;
 Sat, 20 Apr 2019 21:06:12 +0000 (UTC)
 (envelope-from wulf@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3KL6CeM007932;
 Sat, 20 Apr 2019 21:06:12 GMT (envelope-from wulf@FreeBSD.org)
Received: (from wulf@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KL6CM0007931;
 Sat, 20 Apr 2019 21:06:12 GMT (envelope-from wulf@FreeBSD.org)
Message-Id: <201904202106.x3KL6CM0007931@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: wulf set sender to
 wulf@FreeBSD.org using -f
From: Vladimir Kondratyev 
Date: Sat, 20 Apr 2019 21:06:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346458 - head/sys/dev/atkbdc
X-SVN-Group: head
X-SVN-Commit-Author: wulf
X-SVN-Commit-Paths: head/sys/dev/atkbdc
X-SVN-Commit-Revision: 346458
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: D0BC0721D5
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];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 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: Sat, 20 Apr 2019 21:06:13 -0000

Author: wulf
Date: Sat Apr 20 21:06:12 2019
New Revision: 346458
URL: https://svnweb.freebsd.org/changeset/base/346458

Log:
  psm(4): give names to synaptics commands
  
  Submitted by:	Ben LeMasurier 
  MFC after:	2 weeks

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:04:56 2019	(r346457)
+++ head/sys/dev/atkbdc/psm.c	Sat Apr 20 21:06:12 2019	(r346458)
@@ -178,6 +178,22 @@ typedef struct packetbuf {
 #define	PSM_PACKETQUEUE	128
 #endif
 
+/*
+ * Synaptics command definitions.
+ */
+#define	SYNAPTICS_READ_IDENTITY			0x00
+#define	SYNAPTICS_READ_MODES			0x01
+#define	SYNAPTICS_READ_CAPABILITIES		0x02
+#define	SYNAPTICS_READ_MODEL_ID			0x03
+#define	SYNAPTICS_READ_SERIAL_PREFIX		0x06
+#define	SYNAPTICS_READ_SERIAL_SUFFIX		0x07
+#define	SYNAPTICS_READ_RESOLUTIONS		0x08
+#define	SYNAPTICS_READ_EXTENDED			0x09
+#define	SYNAPTICS_READ_CAPABILITIES_CONT	0x0c
+#define	SYNAPTICS_READ_MAX_COORDS		0x0d
+#define	SYNAPTICS_READ_DELUXE_LED		0x0e
+#define	SYNAPTICS_READ_MIN_COORDS		0x0f
+
 typedef struct synapticsinfo {
 	struct sysctl_ctx_list	 sysctl_ctx;
 	struct sysctl_oid	*sysctl_tree;
@@ -1119,7 +1135,7 @@ doopen(struct psm_softc *sc, int command_byte)
 				    "active multiplexing mode.\n",
 				    sc->unit);
 		}
-		mouse_ext_command(sc->kbdc, 1);
+		mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODES);
 		get_mouse_status(sc->kbdc, stat, 0, 3);
 		if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) ||
 		     stat[1] == 0x47) &&
@@ -6158,7 +6174,7 @@ synaptics_set_mode(struct psm_softc *sc, int mode_byte
 	 */
 	if ((sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) &&
 	    sc->hw.model == MOUSE_MODEL_SYNAPTICS && !(mode_byte & (1 << 5))) {
-		mouse_ext_command(sc->kbdc, 3);
+		mouse_ext_command(sc->kbdc, SYNAPTICS_READ_MODEL_ID);
 		set_mouse_sampling_rate(sc->kbdc, 0xc8);
 	}
 }
@@ -6238,7 +6254,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 	set_mouse_scaling(kbdc, 1);
 
 	/* Identify the Touchpad version. */
-	if (mouse_ext_command(kbdc, 0) == 0)
+	if (mouse_ext_command(kbdc, SYNAPTICS_READ_IDENTITY) == 0)
 		return (FALSE);
 	if (get_mouse_status(kbdc, status, 0, 3) != 3)
 		return (FALSE);
@@ -6259,7 +6275,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 	}
 
 	/* Get the Touchpad model information. */
-	if (mouse_ext_command(kbdc, 3) == 0)
+	if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODEL_ID) == 0)
 		return (FALSE);
 	if (get_mouse_status(kbdc, status, 0, 3) != 3)
 		return (FALSE);
@@ -6290,7 +6306,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 	}
 
 	/* Read the extended capability bits. */
-	if (mouse_ext_command(kbdc, 2) == 0)
+	if (mouse_ext_command(kbdc, SYNAPTICS_READ_CAPABILITIES) == 0)
 		return (FALSE);
 	if (get_mouse_status(kbdc, status, 0, 3) != 3)
 		return (FALSE);
@@ -6321,7 +6337,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 
 		if (!set_mouse_scaling(kbdc, 1))
 			return (FALSE);
-		if (mouse_ext_command(kbdc, 0x08) == 0)
+		if (mouse_ext_command(kbdc, SYNAPTICS_READ_RESOLUTIONS) == 0)
 			return (FALSE);
 		if (get_mouse_status(kbdc, status, 0, 3) != 3)
 			return (FALSE);
@@ -6358,7 +6374,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 		if (synhw.nExtendedQueries >= 1) {
 			if (!set_mouse_scaling(kbdc, 1))
 				return (FALSE);
-			if (mouse_ext_command(kbdc, 0x09) == 0)
+			if (mouse_ext_command(kbdc,
+			    SYNAPTICS_READ_EXTENDED) == 0)
 				return (FALSE);
 			if (get_mouse_status(kbdc, status, 0, 3) != 3)
 				return (FALSE);
@@ -6397,7 +6414,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 		if (synhw.nExtendedQueries >= 4) {
 			if (!set_mouse_scaling(kbdc, 1))
 				return (FALSE);
-			if (mouse_ext_command(kbdc, 0x0c) == 0)
+			if (mouse_ext_command(kbdc,
+			    SYNAPTICS_READ_CAPABILITIES_CONT) == 0)
 				return (FALSE);
 			if (get_mouse_status(kbdc, status, 0, 3) != 3)
 				return (FALSE);
@@ -6418,7 +6436,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 			if (synhw.capReportsMax) {
 				if (!set_mouse_scaling(kbdc, 1))
 					return (FALSE);
-				if (mouse_ext_command(kbdc, 0x0d) == 0)
+				if (mouse_ext_command(kbdc,
+				    SYNAPTICS_READ_MAX_COORDS) == 0)
 					return (FALSE);
 				if (get_mouse_status(kbdc, status, 0, 3) != 3)
 					return (FALSE);
@@ -6439,7 +6458,8 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 			if (synhw.capReportsMin) {
 				if (!set_mouse_scaling(kbdc, 1))
 					return (FALSE);
-				if (mouse_ext_command(kbdc, 0x0f) == 0)
+				if (mouse_ext_command(kbdc,
+				    SYNAPTICS_READ_MIN_COORDS) == 0)
 					return (FALSE);
 				if (get_mouse_status(kbdc, status, 0, 3) != 3)
 					return (FALSE);
@@ -6542,7 +6562,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a
 	 * byte of the response to this query to be a constant 0x3b, this
 	 * does not appear to be true for Touchpads with guest devices.
 	 */
-	if (mouse_ext_command(kbdc, 1) == 0)
+	if (mouse_ext_command(kbdc, SYNAPTICS_READ_MODES) == 0)
 		return (FALSE);
 	if (get_mouse_status(kbdc, status, 0, 3) != 3)
 		return (FALSE);

From owner-svn-src-head@freebsd.org  Sat Apr 20 22:31:56 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 404D91577BFF
 for ;
 Sat, 20 Apr 2019 22:31:56 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com
 [IPv6:2607:f8b0:4864:20::743])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id D4AE574C0A
 for ; Sat, 20 Apr 2019 22:31:55 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: by mail-qk1-x743.google.com with SMTP id w20so4640444qka.7
 for ; Sat, 20 Apr 2019 15:31:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=bsdimp-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=1eRTts1CX+1nCVPz573K1PJVtZD+6kzsIl94YWGYO3U=;
 b=Vt2LhWaNGXtjn/m4tqnVkF1hAaAR6jlpqwO8yQewV7Ys1JD221Zk7RPFSP/18EnLuo
 CfXWeolrU1TRhAZ6PoQ3e11pDbjm4QrClIZK70ArsjfZGTkL6DqhGKKYOlB/FNgwMlWL
 o6tJmFUuxwYGHI5VoXfxhDVjUWDhzbupx9c4rou5/H6UpQZakQAJhSAwUcNOJXb53SAk
 MQuqowBRCXs6RWQWzYZBqvnjVtiCqWI5Z9o3T+KqYAbFDKQ7p1DxUQfR+RL2uUNYPnT+
 Js5R4nEdteVCS4TYdhhg4Pt4PGEbCyCY5PFdyjdBPiD6QQX8T8kUdu33KYTPDHzmfzm9
 v6Bw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=1eRTts1CX+1nCVPz573K1PJVtZD+6kzsIl94YWGYO3U=;
 b=pUr8IeiV15OldML6EC9P14ZZE2+YPqtlEJTuIQOUjWH95ltmz2ZkpeoJsNXsc9QA2e
 Y19N6rV3nRISWt+9/5HsMhiTiiYW1Pxk3KL+Sr6x+bxF7ayLi68GwCu7A99mtja7xJkD
 FkC7hRfE4SxnsszdM05iWUimCxK/0+goAv/16SnoNOmntpZVHOAQKWwilFQEP6Pvac6O
 jbYFV0yobXHL5bMSsyVwoEqQIIgKsd9tbOIouzhpDtjGgOsZQ/uhLXK3lxNUfAgltLau
 iiHStIM1sr8Ps8Z6AX9TsP0Ymsf4DYxgehsE6Q4GLyXJuVoMQEQswBXWaXpqAgvvR35O
 d8WQ==
X-Gm-Message-State: APjAAAUhU2+WsicONge5I0hk6j9O87crPbm6KqN6DpCg1EKDGdB/n9Gp
 X3M/swG2kT2qB6tGO7icmFtGydiGJh2f22IeQsPo9g==
X-Google-Smtp-Source: APXvYqz17YYgFRB00jAEQbNcCdOGcAqOBpXd+8kLURMKAJvRmTEOy2vPOnTrn8y7Waysn0DhEPjc2YkL68XrZj/TCN4=
X-Received: by 2002:ae9:ee0c:: with SMTP id i12mr6954404qkg.46.1555799514909; 
 Sat, 20 Apr 2019 15:31:54 -0700 (PDT)
MIME-Version: 1.0
References: <201904201251.x3KCp6it044898@repo.freebsd.org>
 
 
 
 <5bf4a702-7df8-5597-25b0-55baa71d1d4f@FreeBSD.org>
 
 
In-Reply-To: 
From: Warner Losh 
Date: Sat, 20 Apr 2019 16:31:43 -0600
Message-ID: 
Subject: Re: svn commit: r346441 - in head/sys/modules: em fusefs iavf
To: John Baldwin 
Cc: Justin Hibbits , Alan Somers , 
 src-committers ,
 svn-src-all , 
 svn-src-head 
X-Rspamd-Queue-Id: D4AE574C0A
X-Spamd-Bar: ------
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-6.91 / 15.00];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 NEURAL_HAM_SHORT(-0.91)[-0.909,0]; REPLY(-4.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,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: Sat, 20 Apr 2019 22:31:56 -0000

On Sat, Apr 20, 2019 at 2:03 PM John Baldwin  wrote:

> On 4/20/19 10:21 AM, Warner Losh wrote:
> > On Sat, Apr 20, 2019, 10:44 AM John Baldwin  wrote:
> >
> >> On 4/20/19 6:23 AM, Justin Hibbits wrote:
> >>> On Sat, Apr 20, 2019, 08:21 Alan Somers  wrote:
> >>>
> >>>> On Sat, Apr 20, 2019 at 6:58 AM Justin Hibbits 
> >>>> wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Sat, Apr 20, 2019, 07:51 Alan Somers  wrote:
> >>>>>>
> >>>>>> Author: asomers
> >>>>>> Date: Sat Apr 20 12:51:05 2019
> >>>>>> New Revision: 346441
> >>>>>> URL: https://svnweb.freebsd.org/changeset/base/346441
> >>>>>>
> >>>>>> Log:
> >>>>>>   Use symlinks for kernel modules rather than hardlinks
> >>>>>>
> >>>>>>   When aliasing a kernel module to a different name (ie if_igb for
> >>>> if_em),
> >>>>>>   it's better to use symlinks than hard links. kldxref will omit
> >>>> entries for
> >>>>>>   the links, ensuring that the loaded module has the correct name.
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>> Thanks! This should fix installkernel on my POWER9.
> >>>>>
> >>>>> - Justin
> >>>>
> >>>> What's the problem with your POWER9?  Is that one of those msdosfs
> >>>> /boot systems?  If so, I don't think this will fix it.  msdosfs
> >>>> doesn't support either symlinks or hardlinks.  Or is there some other
> >>>> problem?
> >>>> -Alan
> >>>>
> >>>
> >>> Yes it is.  Well that's a bummer then. I thought we faked symlinks on
> >>> msdosfs, but on second thought not sure how well would do that.
> >>
> >> You could just use cp instead of a link?
> >>
> >
> > I don't think this solves the original issue.
>
> FWIW, I think igb and em still use separate driver_t's with separate
> probe tables, etc. to preserve POLA of existing device names, so in
> theory there could still be two modules, it's just by choice that they
> are both in the same C file and same kld.
>

Yea, I sometimes wish they'd have if_em.ko that's just this table and a
dependency to igb.ko plus another if_igb.ko with the same dependency. That
would be cleaner than the hacky thing we're doing which forces us to have
other hacks in kldload, etc.

Warner

From owner-svn-src-head@freebsd.org  Sat Apr 20 23:18:36 2019
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D38181578A7C;
 Sat, 20 Apr 2019 23:18:35 +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 825AD76D1F;
 Sat, 20 Apr 2019 23:18:35 +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 5B75A1CEF9;
 Sat, 20 Apr 2019 23:18:35 +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 x3KNIZj4078517;
 Sat, 20 Apr 2019 23:18:35 GMT (envelope-from cy@FreeBSD.org)
Received: (from cy@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3KNIJWk078502;
 Sat, 20 Apr 2019 23:18:19 GMT (envelope-from cy@FreeBSD.org)
Message-Id: <201904202318.x3KNIJWk078502@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org
 using -f
From: Cy Schubert 
Date: Sat, 20 Apr 2019 23:18:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r346459 - in head/contrib/sqlite3: . tea
X-SVN-Group: head
X-SVN-Commit-Author: cy
X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea
X-SVN-Commit-Revision: 346459
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 825AD76D1F
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)[-1.000,0];
 NEURAL_HAM_SHORT(-0.97)[-0.972,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, 20 Apr 2019 23:18:36 -0000

Author: cy
Date: Sat Apr 20 23:18:19 2019
New Revision: 346459
URL: https://svnweb.freebsd.org/changeset/base/346459

Log:
  MFV r346450:
  
  Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200)
  
  MFC after:	11 days

Modified:
  head/contrib/sqlite3/configure
  head/contrib/sqlite3/configure.ac
  head/contrib/sqlite3/sqlite3.c
  head/contrib/sqlite3/sqlite3.h
  head/contrib/sqlite3/tea/configure
  head/contrib/sqlite3/tea/configure.ac
Directory Properties:
  head/contrib/sqlite3/   (props changed)

Modified: head/contrib/sqlite3/configure
==============================================================================
--- head/contrib/sqlite3/configure	Sat Apr 20 21:06:12 2019	(r346458)
+++ head/contrib/sqlite3/configure	Sat Apr 20 23:18:19 2019	(r346459)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.27.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.27.2.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.27.1'
-PACKAGE_STRING='sqlite 3.27.1'
+PACKAGE_VERSION='3.27.2'
+PACKAGE_STRING='sqlite 3.27.2'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of sqlite 3.27.1:";;
+     short | recursive ) echo "Configuration of sqlite 3.27.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.27.1
+sqlite configure 3.27.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.27.1, which was
+It was created by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.27.1'
+ VERSION='3.27.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.27.1, which was
+This file was extended by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.27.1
+sqlite config.status 3.27.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: head/contrib/sqlite3/configure.ac
==============================================================================
--- head/contrib/sqlite3/configure.ac	Sat Apr 20 21:06:12 2019	(r346458)
+++ head/contrib/sqlite3/configure.ac	Sat Apr 20 23:18:19 2019	(r346459)
@@ -10,7 +10,7 @@
 #
 
 AC_PREREQ(2.61)
-AC_INIT(sqlite, 3.27.1, http://www.sqlite.org)
+AC_INIT(sqlite, 3.27.2, http://www.sqlite.org)
 AC_CONFIG_SRCDIR([sqlite3.c])
 AC_CONFIG_AUX_DIR([.])
 

Modified: head/contrib/sqlite3/sqlite3.c
==============================================================================
--- head/contrib/sqlite3/sqlite3.c	Sat Apr 20 21:06:12 2019	(r346458)
+++ head/contrib/sqlite3/sqlite3.c	Sat Apr 20 23:18:19 2019	(r346459)
@@ -1,6 +1,6 @@
 /******************************************************************************
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.27.1.  By combining all the individual C code files into this
+** version 3.27.2.  By combining all the individual C code files into this
 ** single large file, the entire code can be compiled as a single translation
 ** unit.  This allows many compilers to do optimizations that would not be
 ** possible if the files were compiled separately.  Performance improvements
@@ -1162,9 +1162,9 @@ extern "C" {
 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
 ** [sqlite_version()] and [sqlite_source_id()].
 */
-#define SQLITE_VERSION        "3.27.1"
-#define SQLITE_VERSION_NUMBER 3027001
-#define SQLITE_SOURCE_ID      "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd"
+#define SQLITE_VERSION        "3.27.2"
+#define SQLITE_VERSION_NUMBER 3027002
+#define SQLITE_SOURCE_ID      "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
 
 /*
 ** CAPI3REF: Run-Time Library Version Numbers
@@ -3408,7 +3408,7 @@ SQLITE_API int sqlite3_changes(sqlite3*);
 ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers 
 ** are not counted.
 **
-** This the [sqlite3_total_changes(D)] interface only reports the number
+** The [sqlite3_total_changes(D)] interface only reports the number
 ** of rows that changed due to SQL statement run against database
 ** connection D.  Any changes by other database connections are ignored.
 ** To detect changes against a database file from other database
@@ -14937,57 +14937,56 @@ typedef struct VdbeOpList VdbeOpList;
 #define OP_Sequence      120 /* synopsis: r[P2]=cursor[P1].ctr++           */
 #define OP_NewRowid      121 /* synopsis: r[P2]=rowid                      */
 #define OP_Insert        122 /* synopsis: intkey=r[P3] data=r[P2]          */
-#define OP_InsertInt     123 /* synopsis: intkey=P3 data=r[P2]             */
-#define OP_Delete        124
-#define OP_ResetCount    125
-#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
-#define OP_SorterData    127 /* synopsis: r[P2]=data                       */
-#define OP_RowData       128 /* synopsis: r[P2]=data                       */
-#define OP_Rowid         129 /* synopsis: r[P2]=rowid                      */
-#define OP_NullRow       130
-#define OP_SeekEnd       131
-#define OP_SorterInsert  132 /* synopsis: key=r[P2]                        */
-#define OP_IdxInsert     133 /* synopsis: key=r[P2]                        */
-#define OP_IdxDelete     134 /* synopsis: key=r[P2@P3]                     */
-#define OP_DeferredSeek  135 /* synopsis: Move P3 to P1.rowid if needed    */
-#define OP_IdxRowid      136 /* synopsis: r[P2]=rowid                      */
-#define OP_Destroy       137
-#define OP_Clear         138
-#define OP_ResetSorter   139
-#define OP_CreateBtree   140 /* synopsis: r[P2]=root iDb=P1 flags=P3       */
+#define OP_Delete        123
+#define OP_ResetCount    124
+#define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
+#define OP_SorterData    126 /* synopsis: r[P2]=data                       */
+#define OP_RowData       127 /* synopsis: r[P2]=data                       */
+#define OP_Rowid         128 /* synopsis: r[P2]=rowid                      */
+#define OP_NullRow       129
+#define OP_SeekEnd       130
+#define OP_SorterInsert  131 /* synopsis: key=r[P2]                        */
+#define OP_IdxInsert     132 /* synopsis: key=r[P2]                        */
+#define OP_IdxDelete     133 /* synopsis: key=r[P2@P3]                     */
+#define OP_DeferredSeek  134 /* synopsis: Move P3 to P1.rowid if needed    */
+#define OP_IdxRowid      135 /* synopsis: r[P2]=rowid                      */
+#define OP_Destroy       136
+#define OP_Clear         137
+#define OP_ResetSorter   138
+#define OP_CreateBtree   139 /* synopsis: r[P2]=root iDb=P1 flags=P3       */
+#define OP_SqlExec       140
 #define OP_Real          141 /* same as TK_FLOAT, synopsis: r[P2]=P4       */
-#define OP_SqlExec       142
-#define OP_ParseSchema   143
-#define OP_LoadAnalysis  144
-#define OP_DropTable     145
-#define OP_DropIndex     146
-#define OP_DropTrigger   147
-#define OP_IntegrityCk   148
-#define OP_RowSetAdd     149 /* synopsis: rowset(P1)=r[P2]                 */
-#define OP_Param         150
-#define OP_FkCounter     151 /* synopsis: fkctr[P1]+=P2                    */
-#define OP_MemMax        152 /* synopsis: r[P1]=max(r[P1],r[P2])           */
-#define OP_OffsetLimit   153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
-#define OP_AggInverse    154 /* synopsis: accum=r[P3] inverse(r[P2@P5])    */
-#define OP_AggStep       155 /* synopsis: accum=r[P3] step(r[P2@P5])       */
-#define OP_AggStep1      156 /* synopsis: accum=r[P3] step(r[P2@P5])       */
-#define OP_AggValue      157 /* synopsis: r[P3]=value N=P2                 */
-#define OP_AggFinal      158 /* synopsis: accum=r[P1] N=P2                 */
-#define OP_Expire        159
-#define OP_TableLock     160 /* synopsis: iDb=P1 root=P2 write=P3          */
-#define OP_VBegin        161
-#define OP_VCreate       162
-#define OP_VDestroy      163
-#define OP_VOpen         164
-#define OP_VColumn       165 /* synopsis: r[P3]=vcolumn(P2)                */
-#define OP_VRename       166
-#define OP_Pagecount     167
-#define OP_MaxPgcnt      168
-#define OP_Trace         169
-#define OP_CursorHint    170
-#define OP_Noop          171
-#define OP_Explain       172
-#define OP_Abortable     173
+#define OP_ParseSchema   142
+#define OP_LoadAnalysis  143
+#define OP_DropTable     144
+#define OP_DropIndex     145
+#define OP_DropTrigger   146
+#define OP_IntegrityCk   147
+#define OP_RowSetAdd     148 /* synopsis: rowset(P1)=r[P2]                 */
+#define OP_Param         149
+#define OP_FkCounter     150 /* synopsis: fkctr[P1]+=P2                    */
+#define OP_MemMax        151 /* synopsis: r[P1]=max(r[P1],r[P2])           */
+#define OP_OffsetLimit   152 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
+#define OP_AggInverse    153 /* synopsis: accum=r[P3] inverse(r[P2@P5])    */
+#define OP_AggStep       154 /* synopsis: accum=r[P3] step(r[P2@P5])       */
+#define OP_AggStep1      155 /* synopsis: accum=r[P3] step(r[P2@P5])       */
+#define OP_AggValue      156 /* synopsis: r[P3]=value N=P2                 */
+#define OP_AggFinal      157 /* synopsis: accum=r[P1] N=P2                 */
+#define OP_Expire        158
+#define OP_TableLock     159 /* synopsis: iDb=P1 root=P2 write=P3          */
+#define OP_VBegin        160
+#define OP_VCreate       161
+#define OP_VDestroy      162
+#define OP_VOpen         163
+#define OP_VColumn       164 /* synopsis: r[P3]=vcolumn(P2)                */
+#define OP_VRename       165
+#define OP_Pagecount     166
+#define OP_MaxPgcnt      167
+#define OP_Trace         168
+#define OP_CursorHint    169
+#define OP_Noop          170
+#define OP_Explain       171
+#define OP_Abortable     172
 
 /* Properties such as "out2" or "jump" that are specified in
 ** comments following the "case" for each opcode in the vdbe.c
@@ -15016,12 +15015,12 @@ typedef struct VdbeOpList VdbeOpList;
 /* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
 /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
 /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
-/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\
-/* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
-/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\
-/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
-/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\
-/* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,}
+/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\
+/* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00,\
+/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\
+/* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
+/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,}
 
 /* The sqlite3P2Values() routine is able to run faster if it knows
 ** the value of the largest JUMP opcode.  The smaller the maximum
@@ -19174,7 +19173,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, S
 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
 SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
-SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int, int);
+SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
 SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
 SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
 SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
@@ -32139,57 +32138,56 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
     /* 120 */ "Sequence"         OpHelp("r[P2]=cursor[P1].ctr++"),
     /* 121 */ "NewRowid"         OpHelp("r[P2]=rowid"),
     /* 122 */ "Insert"           OpHelp("intkey=r[P3] data=r[P2]"),
-    /* 123 */ "InsertInt"        OpHelp("intkey=P3 data=r[P2]"),
-    /* 124 */ "Delete"           OpHelp(""),
-    /* 125 */ "ResetCount"       OpHelp(""),
-    /* 126 */ "SorterCompare"    OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
-    /* 127 */ "SorterData"       OpHelp("r[P2]=data"),
-    /* 128 */ "RowData"          OpHelp("r[P2]=data"),
-    /* 129 */ "Rowid"            OpHelp("r[P2]=rowid"),
-    /* 130 */ "NullRow"          OpHelp(""),
-    /* 131 */ "SeekEnd"          OpHelp(""),
-    /* 132 */ "SorterInsert"     OpHelp("key=r[P2]"),
-    /* 133 */ "IdxInsert"        OpHelp("key=r[P2]"),
-    /* 134 */ "IdxDelete"        OpHelp("key=r[P2@P3]"),
-    /* 135 */ "DeferredSeek"     OpHelp("Move P3 to P1.rowid if needed"),
-    /* 136 */ "IdxRowid"         OpHelp("r[P2]=rowid"),
-    /* 137 */ "Destroy"          OpHelp(""),
-    /* 138 */ "Clear"            OpHelp(""),
-    /* 139 */ "ResetSorter"      OpHelp(""),
-    /* 140 */ "CreateBtree"      OpHelp("r[P2]=root iDb=P1 flags=P3"),
+    /* 123 */ "Delete"           OpHelp(""),
+    /* 124 */ "ResetCount"       OpHelp(""),
+    /* 125 */ "SorterCompare"    OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
+    /* 126 */ "SorterData"       OpHelp("r[P2]=data"),
+    /* 127 */ "RowData"          OpHelp("r[P2]=data"),
+    /* 128 */ "Rowid"            OpHelp("r[P2]=rowid"),
+    /* 129 */ "NullRow"          OpHelp(""),
+    /* 130 */ "SeekEnd"          OpHelp(""),
+    /* 131 */ "SorterInsert"     OpHelp("key=r[P2]"),
+    /* 132 */ "IdxInsert"        OpHelp("key=r[P2]"),
+    /* 133 */ "IdxDelete"        OpHelp("key=r[P2@P3]"),
+    /* 134 */ "DeferredSeek"     OpHelp("Move P3 to P1.rowid if needed"),
+    /* 135 */ "IdxRowid"         OpHelp("r[P2]=rowid"),
+    /* 136 */ "Destroy"          OpHelp(""),
+    /* 137 */ "Clear"            OpHelp(""),
+    /* 138 */ "ResetSorter"      OpHelp(""),
+    /* 139 */ "CreateBtree"      OpHelp("r[P2]=root iDb=P1 flags=P3"),
+    /* 140 */ "SqlExec"          OpHelp(""),
     /* 141 */ "Real"             OpHelp("r[P2]=P4"),
-    /* 142 */ "SqlExec"          OpHelp(""),
-    /* 143 */ "ParseSchema"      OpHelp(""),
-    /* 144 */ "LoadAnalysis"     OpHelp(""),
-    /* 145 */ "DropTable"        OpHelp(""),
-    /* 146 */ "DropIndex"        OpHelp(""),
-    /* 147 */ "DropTrigger"      OpHelp(""),
-    /* 148 */ "IntegrityCk"      OpHelp(""),
-    /* 149 */ "RowSetAdd"        OpHelp("rowset(P1)=r[P2]"),
-    /* 150 */ "Param"            OpHelp(""),
-    /* 151 */ "FkCounter"        OpHelp("fkctr[P1]+=P2"),
-    /* 152 */ "MemMax"           OpHelp("r[P1]=max(r[P1],r[P2])"),
-    /* 153 */ "OffsetLimit"      OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
-    /* 154 */ "AggInverse"       OpHelp("accum=r[P3] inverse(r[P2@P5])"),
-    /* 155 */ "AggStep"          OpHelp("accum=r[P3] step(r[P2@P5])"),
-    /* 156 */ "AggStep1"         OpHelp("accum=r[P3] step(r[P2@P5])"),
-    /* 157 */ "AggValue"         OpHelp("r[P3]=value N=P2"),
-    /* 158 */ "AggFinal"         OpHelp("accum=r[P1] N=P2"),
-    /* 159 */ "Expire"           OpHelp(""),
-    /* 160 */ "TableLock"        OpHelp("iDb=P1 root=P2 write=P3"),
-    /* 161 */ "VBegin"           OpHelp(""),
-    /* 162 */ "VCreate"          OpHelp(""),
-    /* 163 */ "VDestroy"         OpHelp(""),
-    /* 164 */ "VOpen"            OpHelp(""),
-    /* 165 */ "VColumn"          OpHelp("r[P3]=vcolumn(P2)"),
-    /* 166 */ "VRename"          OpHelp(""),
-    /* 167 */ "Pagecount"        OpHelp(""),
-    /* 168 */ "MaxPgcnt"         OpHelp(""),
-    /* 169 */ "Trace"            OpHelp(""),
-    /* 170 */ "CursorHint"       OpHelp(""),
-    /* 171 */ "Noop"             OpHelp(""),
-    /* 172 */ "Explain"          OpHelp(""),
-    /* 173 */ "Abortable"        OpHelp(""),
+    /* 142 */ "ParseSchema"      OpHelp(""),
+    /* 143 */ "LoadAnalysis"     OpHelp(""),
+    /* 144 */ "DropTable"        OpHelp(""),
+    /* 145 */ "DropIndex"        OpHelp(""),
+    /* 146 */ "DropTrigger"      OpHelp(""),
+    /* 147 */ "IntegrityCk"      OpHelp(""),
+    /* 148 */ "RowSetAdd"        OpHelp("rowset(P1)=r[P2]"),
+    /* 149 */ "Param"            OpHelp(""),
+    /* 150 */ "FkCounter"        OpHelp("fkctr[P1]+=P2"),
+    /* 151 */ "MemMax"           OpHelp("r[P1]=max(r[P1],r[P2])"),
+    /* 152 */ "OffsetLimit"      OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
+    /* 153 */ "AggInverse"       OpHelp("accum=r[P3] inverse(r[P2@P5])"),
+    /* 154 */ "AggStep"          OpHelp("accum=r[P3] step(r[P2@P5])"),
+    /* 155 */ "AggStep1"         OpHelp("accum=r[P3] step(r[P2@P5])"),
+    /* 156 */ "AggValue"         OpHelp("r[P3]=value N=P2"),
+    /* 157 */ "AggFinal"         OpHelp("accum=r[P1] N=P2"),
+    /* 158 */ "Expire"           OpHelp(""),
+    /* 159 */ "TableLock"        OpHelp("iDb=P1 root=P2 write=P3"),
+    /* 160 */ "VBegin"           OpHelp(""),
+    /* 161 */ "VCreate"          OpHelp(""),
+    /* 162 */ "VDestroy"         OpHelp(""),
+    /* 163 */ "VOpen"            OpHelp(""),
+    /* 164 */ "VColumn"          OpHelp("r[P3]=vcolumn(P2)"),
+    /* 165 */ "VRename"          OpHelp(""),
+    /* 166 */ "Pagecount"        OpHelp(""),
+    /* 167 */ "MaxPgcnt"         OpHelp(""),
+    /* 168 */ "Trace"            OpHelp(""),
+    /* 169 */ "CursorHint"       OpHelp(""),
+    /* 170 */ "Noop"             OpHelp(""),
+    /* 171 */ "Explain"          OpHelp(""),
+    /* 172 */ "Abortable"        OpHelp(""),
   };
   return azName[i];
 }
@@ -87935,14 +87933,7 @@ case OP_NewRowid: {           /* out2 */
 ** This instruction only works on tables.  The equivalent instruction
 ** for indices is OP_IdxInsert.
 */
-/* Opcode: InsertInt P1 P2 P3 P4 P5
-** Synopsis: intkey=P3 data=r[P2]
-**
-** This works exactly like OP_Insert except that the key is the
-** integer value P3, not the value of the integer stored in register P3.
-*/
-case OP_Insert: 
-case OP_InsertInt: {
+case OP_Insert: {
   Mem *pData;       /* MEM cell holding data for the record to be inserted */
   Mem *pKey;        /* MEM cell holding key  for the record */
   VdbeCursor *pC;   /* Cursor to table into which insert is written */
@@ -87963,16 +87954,11 @@ case OP_InsertInt: {
   REGISTER_TRACE(pOp->p2, pData);
   sqlite3VdbeIncrWriteCounter(p, pC);
 
-  if( pOp->opcode==OP_Insert ){
-    pKey = &aMem[pOp->p3];
-    assert( pKey->flags & MEM_Int );
-    assert( memIsValid(pKey) );
-    REGISTER_TRACE(pOp->p3, pKey);
-    x.nKey = pKey->u.i;
-  }else{
-    assert( pOp->opcode==OP_InsertInt );
-    x.nKey = pOp->p3;
-  }
+  pKey = &aMem[pOp->p3];
+  assert( pKey->flags & MEM_Int );
+  assert( memIsValid(pKey) );
+  REGISTER_TRACE(pOp->p3, pKey);
+  x.nKey = pKey->u.i;
 
   if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
     assert( pC->iDb>=0 );
@@ -96131,7 +96117,39 @@ SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(
   return 0;
 }
 
+#ifndef SQLITE_OMIT_WINDOWFUNC
 /*
+** Walker callback for resolveRemoveWindows().
+*/
+static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){
+  if( ExprHasProperty(pExpr, EP_WinFunc) ){
+    Window **pp;
+    for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
+      if( *pp==pExpr->y.pWin ){
+        *pp = (*pp)->pNextWin;
+        break;
+      }    
+    }
+  }
+  return WRC_Continue;
+}
+
+/*
+** Remove any Window objects owned by the expression pExpr from the
+** Select.pWin list of Select object pSelect.
+*/
+static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){
+  Walker sWalker;
+  memset(&sWalker, 0, sizeof(Walker));
+  sWalker.xExprCallback = resolveRemoveWindowsCb;
+  sWalker.u.pSelect = pSelect;
+  sqlite3WalkExpr(&sWalker, pExpr);
+}
+#else
+# define resolveRemoveWindows(x,y)
+#endif
+
+/*
 ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
 ** The Name context of the SELECT statement is pNC.  zType is either
 ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
@@ -96197,19 +96215,10 @@ static int resolveOrderGroupBy(
     }
     for(j=0; jpEList->nExpr; j++){
       if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){
-#ifndef SQLITE_OMIT_WINDOWFUNC
-        if( ExprHasProperty(pE, EP_WinFunc) ){
-          /* Since this window function is being changed into a reference
-          ** to the same window function the result set, remove the instance
-          ** of this window function from the Select.pWin list. */
-          Window **pp;
-          for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
-            if( *pp==pE->y.pWin ){
-              *pp = (*pp)->pNextWin;
-            }    
-          }
-        }
-#endif
+        /* Since this expresion is being changed into a reference
+        ** to an identical expression in the result set, remove all Window
+        ** objects belonging to the expression from the Select.pWin list. */
+        resolveRemoveWindows(pSelect, pE);
         pItem->u.x.iOrderByCol = j+1;
       }
     }
@@ -99181,14 +99190,11 @@ SQLITE_PRIVATE int sqlite3FindInIndex(
     eType = IN_INDEX_EPH;
     if( inFlags & IN_INDEX_LOOP ){
       pParse->nQueryLoop = 0;
-      if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){
-        eType = IN_INDEX_ROWID;
-      }
     }else if( prRhsHasNull ){
       *prRhsHasNull = rMayHaveNull = ++pParse->nMem;
     }
     assert( pX->op==TK_IN );
-    sqlite3CodeRhsOfIN(pParse, pX, iTab, eType==IN_INDEX_ROWID);
+    sqlite3CodeRhsOfIN(pParse, pX, iTab);
     if( rMayHaveNull ){
       sqlite3SetHasNullFlag(v, iTab, rMayHaveNull);
     }
@@ -99289,12 +99295,6 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars
 ** however the cursor number returned might not be the same, as it might
 ** have been duplicated using OP_OpenDup.
 **
-** If parameter isRowid is non-zero, then LHS of the IN operator is guaranteed
-** to be a non-null integer. In this case, the ephemeral table can be an
-** table B-Tree that keyed by only integers.  The more general cases uses
-** an index B-Tree which can have arbitrary keys, but is slower to both
-** read and write.
-**
 ** If the LHS expression ("x" in the examples) is a column value, or
 ** the SELECT statement returns a column value, then the affinity of that
 ** column is used to build the index keys. If both 'x' and the
@@ -99306,8 +99306,7 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars
 SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
   Parse *pParse,          /* Parsing context */
   Expr *pExpr,            /* The IN operator */
-  int iTab,               /* Use this cursor number */
-  int isRowid             /* If true, LHS is a rowid */
+  int iTab                /* Use this cursor number */
 ){
   int addrOnce = 0;           /* Address of the OP_Once instruction at top */
   int addr;                   /* Address of OP_OpenEphemeral instruction */
@@ -99360,14 +99359,12 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
   /* Check to see if this is a vector IN operator */
   pLeft = pExpr->pLeft;
   nVal = sqlite3ExprVectorSize(pLeft);
-  assert( !isRowid || nVal==1 );
 
   /* Construct the ephemeral table that will contain the content of
   ** RHS of the IN operator.
   */
   pExpr->iTable = iTab;
-  addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, 
-      pExpr->iTable, (isRowid?0:nVal));
+  addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, nVal);
 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
   if( ExprHasProperty(pExpr, EP_xIsSelect) ){
     VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId));
@@ -99375,7 +99372,7 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
     VdbeComment((v, "RHS of IN operator"));
   }
 #endif
-  pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
+  pKeyInfo = sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
 
   if( ExprHasProperty(pExpr, EP_xIsSelect) ){
     /* Case 1:     expr IN (SELECT ...)
@@ -99389,7 +99386,6 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
     ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d",
         addrOnce?"":"CORRELATED ", pSelect->selId
     ));
-    assert( !isRowid );
     /* If the LHS and RHS of the IN operator do not match, that
     ** error will have been caught long before we reach this point. */
     if( ALWAYS(pEList->nExpr==nVal) ){
@@ -99442,10 +99438,8 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
     /* Loop through each expression in . */
     r1 = sqlite3GetTempReg(pParse);
     r2 = sqlite3GetTempReg(pParse);
-    if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC);
     for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
       Expr *pE2 = pItem->pExpr;
-      int iValToIns;
 
       /* If the expression is not constant then we will need to
       ** disable the test that was generated above that makes sure
@@ -99458,20 +99452,9 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
       }
 
       /* Evaluate the expression and insert it into the temp table */
-      if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
-        sqlite3VdbeAddOp3(v, OP_InsertInt, iTab, r2, iValToIns);
-      }else{
-        r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
-        if( isRowid ){
-          sqlite3VdbeAddOp2(v, OP_MustBeInt, r3,
-                            sqlite3VdbeCurrentAddr(v)+2);
-          VdbeCoverage(v);
-          sqlite3VdbeAddOp3(v, OP_Insert, iTab, r2, r3);
-        }else{
-          sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
-          sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
-        }
-      }
+      r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
+      sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
+      sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
     }
     sqlite3ReleaseTempReg(pParse, r1);
     sqlite3ReleaseTempReg(pParse, r2);
@@ -118107,10 +118090,13 @@ SQLITE_PRIVATE void sqlite3CompleteInsertion(
       pik_flags |= (update_flags & OPFLAG_SAVEPOSITION);
 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
       if( update_flags==0 ){
-        sqlite3VdbeAddOp4(v, OP_InsertInt, 
-            iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE
+        int r = sqlite3GetTempReg(pParse);
+        sqlite3VdbeAddOp2(v, OP_Integer, 0, r);
+        sqlite3VdbeAddOp4(v, OP_Insert, 
+            iIdxCur+i, aRegIdx[i], r, (char*)pTab, P4_TABLE
         );
         sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP);
+        sqlite3ReleaseTempReg(pParse, r);
       }
 #endif
     }
@@ -136427,7 +136413,6 @@ static int codeEqualityTerm(
         if( pLoop->aLTerm[i]->pExpr==pX ){
           int iOut = iReg + i - iEq;
           if( eType==IN_INDEX_ROWID ){
-            testcase( nEq>1 );  /* Happens with a UNIQUE index on ROWID */
             pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
           }else{
             int iCol = aiMap ? aiMap[iMap++] : 0;
@@ -137189,6 +137174,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
     sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg);
     VdbeCoverage(v);
     pLevel->op = OP_Noop;
+    if( (pTerm->prereqAll & pLevel->notReady)==0 ){
+      pTerm->wtFlags |= TERM_CODED;
+    }
   }else if( (pLoop->wsFlags & WHERE_IPK)!=0
          && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0
   ){
@@ -217076,7 +217064,7 @@ static void fts5SourceIdFunc(
 ){
   assert( nArg==0 );
   UNUSED_PARAM2(nArg, apUnused);
-  sqlite3_result_text(pCtx, "fts5: 2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd", -1, SQLITE_TRANSIENT);
+  sqlite3_result_text(pCtx, "fts5: 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7", -1, SQLITE_TRANSIENT);
 }
 
 /*
@@ -221840,9 +221828,9 @@ SQLITE_API int sqlite3_stmt_init(
 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
 
 /************** End of stmt.c ************************************************/
-#if __LINE__!=221843
+#if __LINE__!=221831
 #undef SQLITE_SOURCE_ID
-#define SQLITE_SOURCE_ID      "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959alt2"
+#define SQLITE_SOURCE_ID      "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt2"
 #endif
 /* Return the source-id for this library */
 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }

Modified: head/contrib/sqlite3/sqlite3.h
==============================================================================
--- head/contrib/sqlite3/sqlite3.h	Sat Apr 20 21:06:12 2019	(r346458)
+++ head/contrib/sqlite3/sqlite3.h	Sat Apr 20 23:18:19 2019	(r346459)
@@ -123,9 +123,9 @@ extern "C" {
 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
 ** [sqlite_version()] and [sqlite_source_id()].
 */
-#define SQLITE_VERSION        "3.27.1"
-#define SQLITE_VERSION_NUMBER 3027001
-#define SQLITE_SOURCE_ID      "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd"
+#define SQLITE_VERSION        "3.27.2"
+#define SQLITE_VERSION_NUMBER 3027002
+#define SQLITE_SOURCE_ID      "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
 
 /*
 ** CAPI3REF: Run-Time Library Version Numbers
@@ -2369,7 +2369,7 @@ SQLITE_API int sqlite3_changes(sqlite3*);
 ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers 
 ** are not counted.
 **
-** This the [sqlite3_total_changes(D)] interface only reports the number
+** The [sqlite3_total_changes(D)] interface only reports the number
 ** of rows that changed due to SQL statement run against database
 ** connection D.  Any changes by other database connections are ignored.
 ** To detect changes against a database file from other database

Modified: head/contrib/sqlite3/tea/configure
==============================================================================
--- head/contrib/sqlite3/tea/configure	Sat Apr 20 21:06:12 2019	(r346458)
+++ head/contrib/sqlite3/tea/configure	Sat Apr 20 23:18:19 2019	(r346459)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.27.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.27.2.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -577,8 +577,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.27.1'
-PACKAGE_STRING='sqlite 3.27.1'
+PACKAGE_VERSION='3.27.2'
+PACKAGE_STRING='sqlite 3.27.2'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1365,7 +1365,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of sqlite 3.27.1:";;
+     short | recursive ) echo "Configuration of sqlite 3.27.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1467,7 +1467,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.27.1
+sqlite configure 3.27.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1878,7 +1878,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.27.1, which was
+It was created by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -9373,7 +9373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.27.1, which was
+This file was extended by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -9426,7 +9426,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.27.1
+sqlite config.status 3.27.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: head/contrib/sqlite3/tea/configure.ac
==============================================================================
--- head/contrib/sqlite3/tea/configure.ac	Sat Apr 20 21:06:12 2019	(r346458)
+++ head/contrib/sqlite3/tea/configure.ac	Sat Apr 20 23:18:19 2019	(r346459)
@@ -19,7 +19,7 @@ dnl	to configure the system for the local environment.
 # so you can encode the package version directly into the source files.
 #-----------------------------------------------------------------------
 
-AC_INIT([sqlite], [3.27.1])
+AC_INIT([sqlite], [3.27.2])
 
 #--------------------------------------------------------------------
 # Call TEA_INIT as the first TEA_ macro to set up initial vars.